program Bounding
    implicit none
    integer(4):: n,x,nx,i
    integer(4),allocatable:: l(:)

    read*, n,x
    allocate(l(n))
    read*, l(:)
    nx=0
    do i=1,n
        nx=nx+l(i)
        if (nx > x) then
            print*, i
            stop
        end if
    end do
    print*, n+1


end program Bounding