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)|
	if sum + l > x
		@ret = i + 1
		break
	end
	sum + l
end
p @ret != 0 ? @ret : ls.size + 1