from itertools import accumulate

from bisect import *

N, X = list(map(int, input().split()))

L = list(tuple(map(int, input().split())))



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



n = bisect_right(acc,X)

print(n)



N,X = list(map(int,input().split()))

L = list(map(int,input().split()))

List = [0]*(N+1)

for i in range(1,N+1):

    List[i] = List[i-1] + L[i-1]

A = [i for i in List if i <=X]

print((len(A)))
from itertools import accumulate
from bisect import *

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

N, X = list(map(int, input().split()))
L = list(map(int, input().split()))
List = [0] * (N + 1)
for i in range(1, N + 1):
    List[i] = List[i - 1] + L[i - 1]
A = [i for i in List if i <= X]
print((len(A)))

-from itertools import accumulate -from bisect import * - -L = list(tuple(map(int, input().split()))) -acc = sorted(list(accumulate(L)) + [0]) -n = bisect_right(acc, X) -print(n) +L = list(map(int, input().split())) +List = [0] * (N + 1) +for i in range(1, N + 1): +    List[i] = List[i - 1] + L[i - 1] +A = [i for i in List if i <= X] +print((len(A)))