Question
The Fitness Tracker's Calorie Streak

A fitness tracker logs the net calorie change for each of N days in a row (a value can be negative on days where more calories were burned than consumed). The change on day i is A_i.

Find the length of the longest contiguous streak of days whose net calorie change sums to exactly a target value K.

Input

The first line contains two integers KaTeX can only parse string typed expression and KaTeX can only parse string typed expression — the number of days and the target sum. If KaTeX can only parse string typed expression, there are no days.

The second line contains KaTeX can only parse string typed expression integers KaTeX can only parse string typed expression.

Output

Print a single integer — the length of the longest streak summing to exactly KaTeX can only parse string typed expression, or KaTeX can only parse string typed expression if no such streak exists.

Example
Example 1:
Input
6 3

2 -1 3 1 -2 4
Output
5
Explanation
The streak from day 1 to day 5 (KaTeX can only parse string typed expression) sums to exactly the target, and has length 5, which is the longest such streak.

Example 2:
Input
3 100

1 2 3
Output
0
Explanation
No contiguous streak of days sums to KaTeX can only parse string typed expression, so the answer is KaTeX can only parse string typed expression.

Example 3:
Input
1 5

5
Output
1
Explanation
The single day itself sums to exactly the target, giving a streak of length 1.

Online