n , k = input().split()
n = int(n)
k = int(k)
a = list(map(int,input().split()))
count = 0 #人数
total = 0
for i in range(len(a)):
total = total + a[i]
# 如果重量不大于k 并且已经是最后一块蛋糕了,还是算分到一个人
if (total < k and i == n - 1):
count = count + 1
if (total >= k):
count = count + 1
total = 0
# 不满足重量条件不断返回原来叠加
if (total < k):
continue
print(count)
注意 if (total < k and i == n - 1):条件必须写在最前面,否则某些情况会少丢掉一个人