def cumsum(xs):
    result = [0,xs[0]]
    for x in xs[1:]:
        result.append(result[-1] + x)
    return result
a,b=map(int,input().split())
c=list(map(int,input().split()))
n=cumsum(c)
ans=[]
for i in range(len(n)):
    if n[i]<=b:
        ans.append(n[i])
print(len(ans)) def cumsum(xs):
    result = [0,xs[0]]
    for x in xs[1:]:
        result.append(result[-1] + x)
    return result cumsum result = [0,xs[0]] result [0,xs[0]] 0 xs[0] xs 0 for x in xs[1:]:
        result.append(result[-1] + x)
     x xs[1:] xs 1: 1 result.append(result[-1] + x) result.append result append result[-1] + x result[-1] result -1 x return result result xs xs a,b=map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b c=list(map(int,input().split())) c list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split n=cumsum(c) n cumsum(c) cumsum c ans=[] ans [] for i in range(len(n)):
    if n[i]<=b:
        ans.append(n[i]) i range(len(n)) range len(n) len n if n[i]<=b:
        ans.append(n[i]) n[i]<=b n[i] n i b ans.append(n[i]) ans.append ans append n[i] n i print(len(ans)) print len(ans) len ans c=list(map(int,input().split())) list(map(int,input().split())) c ans=[] [] ans a,b=map(int,input().split()) map(int,input().split()) a n=cumsum(c) cumsum(c) n b=map(int,input().split()) map(int,input().split()) b def cumsum(xs):
    result = [0,xs[0]]
    for x in xs[1:]:
        result.append(result[-1] + x)
    return result def cumsum(xs):
    result = [0,xs[0]]
    for x in xs[1:]:
        result.append(result[-1] + x)
    return result cumsum
def cumsum(xs):
    result = [0,xs[0]]
    for x in xs[1:]:
        result.append(result[-1] + x)
    return result
a,b=map(int,input().split())
c=list(map(int,input().split()))
n=cumsum(c)
ans=[]
for i in range(len(n)):
    if n[i]<=b:
        ans.append(n[i])
print(len(ans))