Weighing of Souls


Submit solution

Points: 1
Time limit: 1.5s
Memory limit: 256M

Author:
Problem type
Allowed languages
C, C++, Java, Python

In the courts of ancient Egypt, the god Anubis weighs the souls of the dead in a long ceremonial line. There are N souls waiting to be judged, and each soul has a known weight of virtue in grams. Anubis must choose exactly X grams for a rite of passage. Because the procession is sacred, he may only select a contiguous group of souls and will not rearrange their order.

Given the weights of the souls in order, find out how many ways Anubis can choose a contiguous group of souls whose total weight is exactly X.

Input

The first line will contain two integers, N - the number of souls in the procession (1 \leq N \leq 10^6), and X - the target weight (0 \leq X \leq 10^9)

There will then be N integers, where W_i represents the weight of the i^{th} cow (1 \leq W \leq 10^6)

Output

Output the number of different ways Anubis can get exactly X grams from the souls.

Example

Input
5 300
100 200 150 50 100
Output
2

Explanation: Indices [0, 1] sum to 300 (100 + 200), and indices [2, 4] sum to 300 (150 + 50 + 100)


Comments

There are no comments at the moment.