def candy(arr, n, x):
	if sum(arr) == x:
		return n
	best = 0
	j = 0
	while(j < n):
		c = 0
		for i in range(j, n-1):
			if arr[i] < x:
				c += 1
				x -= arr[i]
			elif arr[i] == x:
				c += 1
				break
		best = max(best, c)
		j += 1
	if arr[n-1] == x:
		best += 1
	return best
n, x = map(int, input().split())
arr = list(map(int, input().split()))
print(candy(arr, n, x))