N, K = list(map(int, input().split()))
alist = list(map(int, input().split()))

c = 0
while sum(alist) >= K :
    c += 1
    lst2 = alist[1:]
    while sum(lst2) >= K :
        c += 1
        del lst2[0]
    del alist[-1]

print(c)