시간 초과 소스
a, b = map(int, input().split())
arr = [0] * (a + 1)
arr = list(map(int, input().split()))
cnt = 0
sum=0
#print("7+8+9",arr[7]+arr[8]+arr[9])
for i in range(0, a, 1):
if arr[i] == b:
cnt = cnt + 1
# print("First Done")
sum=arr[i]
for j in range(i+1, a, 1):
sum=sum+arr[j]
if sum>b:
continue
elif sum==b:
cnt=cnt+1
# print("cnt:",cnt,)
#print("arr[",i,"]:",arr[i],"arr[",j,"]:",arr[j])
print(cnt)