# #include <stdio.h>
# int main()
# {
# printf("10 6");
# return 0;
# }
# #include <stdio.h>
# int main()
# {
# int d1[101] = {}, d2[101] = {},n,a,b,x,empty = 0, full = 0;
# scanf("%d%d%d",&n,&a,&b);
# for(int i = 0;i<a;i++){
# scanf("%d",&x);
# d1[x] = 1;
# }
# for(int i = 0;i<b;i++){
# scanf("%d",&x);
# d2[x] = 1;
# }
# for(int i = 1;i<=n;i++){
# if(d1[i] != d2[i]) continue;
# else if(d1[i] == 0) empty++;
# else full++;
# }
# printf("%d %d",empty,full);
# return 0;
# }
# import sys
# limit_number = 2000000
# sys.setrecursionlimit(limit_number)
#
# def f(m1, m2):
# global p, n, m, di, d
# p = p + 1
# d[m1][m2] = 1
# for i in range(4):
# if 0 <= m1 + di[i][0] < m and 0 <= m2 + di[i][1] < n and d[m1 + di[i][0]][m2 + di[i][1]] == 0:
# f(m1 + di[i][0], m2 + di[i][1])
#
#
# m, n, k = map(int, input().split())
# di = [[1, 0], [0, 1], [-1, 0], [0, -1]]
# d = []
# for i in range(m):
# v = [0] * n
# d.append(v)
#
# for i in range(k):
# x1, y1, x2, y2 = map(int, input().split())
# for j in range(x1, x2, 1):
# for ij in range(y1, y2, 1):
# d[ij][j] = 1
#
# p = 0
# zone = 0
# zo = []
# i = 0
# j = 0
# for i in range(m):
# for j in range(n):
# if d[i][j] == 0:
# p = 0
# f(i, j)
# if p != 0:
# zone = zone + 1
# zo.append(p)
#
# print(zone)
# zo.sort()
# for i in range(len(zo)):
# print(zo[i], end=' ')
# import sys
# limit_number = 2000000
# sys.setrecursionlimit(limit_number)
#
#
# def f(k):
# global ch, d, n
# ch[k] = 1
# for i in range(n + 1):
# if ch[i] == 0 and d[k][i] == 1:
# ch[k] = 1
# f(i)
#
#
# n = int(input())
# m = int(input())
# d = []
# ch = [0] * (n + 1)
# for i in range(n + 1):
# v = [0] * (n + 1)
# d.append(v)
#
# for i in range(m):
# x, y = map(int, input().split())
# d[x][y] = 1
# d[y][x] = 1
#
# f(1)
#
# p = 0
# for i in range(2, n + 1, 1):
# if ch[i] == 1:
# p = p + 1
#
# print(p)
# import sys
# limit_number = 2000000
# sys.setrecursionlimit(limit_number)
#
#
# def f(a, b, k):
# global n, d, ch, di
# ch[a][b] = 1
# for i in range(4):
# if 0<= a + di[i][0] < n and 0<= b + di[i][1] < n and d[a + di[i][0]][b + di[i][1]] > k and ch[a + di[i][0]][b + di[i][1]] == 0:
# ch[a + di[i][0]][b + di[i][1]] = 1
# f(a + di[i][0], b + di[i][1], k)
#
#
# def g():
# global ch, n
# for i in range(n):
# for j in range(n):
# ch[i][j] = 0
#
#
# n = int(input())
# d = []
# ch = []
# di = [[1, 0], [0, 1], [-1, 0], [0, -1]]
# max = 0
# for i in range(n):
# v = list(map(int, input().split()))
# d.append(v)
# v1 = [0] * n
# ch.append(v1)
# for j in range(n):
# if d[i][j] > max:
# max = d[i][j]
#
# maxp = 0
# for i in range(max):
# g()
# p = 0
# for i1 in range(n):
# for j1 in range(n):
# if d[i1][j1] > i and ch[i1][j1] == 0:
# ch[i1][j1] = 1
# f(i1, j1, i)
# p = p + 1
# if p > maxp:
# maxp = p
#
# print(maxp)
# import sys
# limit_number = 2000000
# sys.setrecursionlimit(limit_number)
#
#
# def f(a, b, k):
# global n, d, m, x
# if k == d[(a + b)//2]:
# x = (a + b)//2 + 1
# return
# elif k > d[(a + b)//2]:
# if k < d[(a + b)//2 + 1]:
# x = - 1
# return
# if k == d[(a + b) // 2 + 1]:
# x = (a + b) // 2 + 2
# return
# f((a + b)//2, b, k)
# else:
# if k > d[(a + b)//2 - 1]:
# x = - 1
# return
# if k == d[(a + b) // 2 - 1]:
# x = (a + b) // 2
# return
# f(a, (a + b)//2, k)
#
#
# n = int(input())
# d = list(map(int, input().split()))
# m = int(input())
# x = - 1
# t = list(map(int, input().split()))
# for i in range(m):
# f(0, n - 1, t[i])
# print(x, end=' ')
n, k = map(int, input().split())
d = list(map(int, input().split()))
ss = [0] * (n + 1)
s = 0
ss[0] = 0
for i in range(n):
s = s + d[i]
ss[i + 1] = s
p = 0
for i in range(n):
if ss[i + 1] < k:
continue
if d[i] > k:
continue
for j in range(i + 1):
rs = 0
rs = ss[i + 1] - ss[j]
if rs == k:
p = p + 1
if rs < k:
break
print(p)