n, x = gets.split.map(&:to_i)
ls = gets.split.map(&:to_i)
ret = 0

ls.each_with_index.inject(0) do |sum, (l, i)|
	(ret = i + 1) && break if sum + l > x
	ret = i + 2 if i == ls.size - 1
	sum + l
end

p ret