import sys

input = sys.stdin.readline

n, m = map(int, input().split())
nums = list(map(int, input().split()))
left = 0
right = 0
s = nums[0]
result = 0

while True:
    if s >= m:
        if s == m:
            result += 1

        s -= nums[left]
        left += 1
    else:
        right += 1
        if right >= n:
            break

        s += nums[right]

print(result)
