import bisect

n,x = map(int, input().split())
l = tuple(map(int, input().split()))

d = [-1]*(n+1)
d[0] = 0
for i in range(1, n+1):
    d[i] = d[i-1] + l[i-1]
res = bisect.bisect_right(sorted(d), x)
print(res) import bisect bisect n,x = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split x l = tuple(map(int, input().split())) l tuple(map(int, input().split())) tuple map(int, input().split()) map int input().split() ().split () input split d = [-1]*(n+1) d [-1]*(n+1) [-1] -1 n+1 n 1 d[0] = 0 d[0] d 0 0 for i in range(1, n+1):
    d[i] = d[i-1] + l[i-1] i range(1, n+1) range 1 n+1 n 1 d[i] = d[i-1] + l[i-1] d[i] d i d[i-1] + l[i-1] d[i-1] d i-1 i 1 l[i-1] l i-1 i 1 res = bisect.bisect_right(sorted(d), x) res bisect.bisect_right(sorted(d), x) bisect.bisect_right bisect bisect_right sorted(d) sorted d x print(res) print res d = [-1]*(n+1) [-1]*(n+1) d res = bisect.bisect_right(sorted(d), x) bisect.bisect_right(sorted(d), x) res x = map(int, input().split()) map(int, input().split()) x l = tuple(map(int, input().split())) tuple(map(int, input().split())) l n,x = map(int, input().split()) map(int, input().split()) n
import bisect

n,x = map(int, input().split())
l = tuple(map(int, input().split()))

d = [-1]*(n+1)
d[0] = 0
for i in range(1, n+1):
    d[i] = d[i-1] + l[i-1]
res = bisect.bisect_right(sorted(d), x)
print(res)