from itertools import accumulate
from bisect import *
N, X = map(int, input().split())
L = list(tuple(map(int, input().split())))

acc = sorted(list(accumulate(L)) + [0])

n = bisect_right(acc,X)
print(n)
 from itertools import accumulate from bisect import * N, X = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split X L = list(tuple(map(int, input().split()))) L list(tuple(map(int, input().split()))) list tuple(map(int, input().split())) tuple map(int, input().split()) map int input().split() ().split () input split acc = sorted(list(accumulate(L)) + [0]) acc sorted(list(accumulate(L)) + [0]) sorted list(accumulate(L)) + [0] list(accumulate(L)) list accumulate(L) accumulate L [0] 0 n = bisect_right(acc,X) n bisect_right(acc,X) bisect_right acc X print(n) print n X = map(int, input().split()) map(int, input().split()) X L = list(tuple(map(int, input().split()))) list(tuple(map(int, input().split()))) L acc = sorted(list(accumulate(L)) + [0]) sorted(list(accumulate(L)) + [0]) acc N, X = map(int, input().split()) map(int, input().split()) N n = bisect_right(acc,X) bisect_right(acc,X) n
from itertools import accumulate
from bisect import *
N, X = map(int, input().split())
L = list(tuple(map(int, input().split())))

acc = sorted(list(accumulate(L)) + [0])

n = bisect_right(acc,X)
print(n)

