import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner kb = new Scanner(System.in);
int n = kb.nextInt();
int m = kb.nextInt();
int[] prefixSum = new int[n];
prefixSum[0] = kb.nextInt();
for (int i = 1; i < n; i++) {
prefixSum[i] = prefixSum[i - 1] + kb.nextInt();
}
int count = 0;
int lt = 0, rt = 0;
while (lt < n && rt < n) {
int sum;
if (lt == 0) {
sum = prefixSum[rt];
} else {
sum = prefixSum[rt] - prefixSum[lt - 1];
}
if (sum < m) {
rt++;
} else if (sum > m) {
lt++;
} else {
count++;
rt++;
}
}
System.out.println(count);
}
}