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

L = [0] + [int(x) for x in input().split()]



D = [0] * (N+2)

answer = 1

for n in range(2,N+2):

  D[n] = D[n-1] + L[n-1]

  if D[n] <= X:

    answer += 1

    

print(answer)
import sys

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines



import itertools



N,X,*L = list(map(int,read().split()))



answer = sum(x <= X for x in itertools.accumulate([0]+L))

print(answer)
N, X = list(map(int, input().split()))
L = [0] + [int(x) for x in input().split()]
D = [0] * (N + 2)
answer = 1
for n in range(2, N + 2):
    D[n] = D[n - 1] + L[n - 1]
    if D[n] <= X:
        answer += 1
print(answer)

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import itertools

N, X, *L = list(map(int, read().split()))
answer = sum(x <= X for x in itertools.accumulate([0] + L))
print(answer)

-N, X = list(map(int, input().split())) -L = [0] + [int(x) for x in input().split()] -D = [0] * (N + 2) -answer = 1 -for n in range(2, N + 2): -    D[n] = D[n - 1] + L[n - 1] -    if D[n] <= X: -        answer += 1 +import sys + +read = sys.stdin.buffer.read +readline = sys.stdin.buffer.readline +readlines = sys.stdin.buffer.readlines +import itertools + +N, X, *L = list(map(int, read().split())) +answer = sum(x <= X for x in itertools.accumulate([0] + L))