#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, k;
  cin >> n >> k;
  long long int ans = 0;
  int last;
  last = 1;
  long long int a[n + 1];
  long long int sum[n + 1];
  sum[0] = a[0] = 0;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    sum[i] = sum[i - 1] + a[i];
  }
  for (int i = 0; i < n; i++) {
    if (sum[n] < k) break;
    for (int j = last; j <= n; j++) {
      if (sum[j] - sum[i] >= k) {
        ans += n - j + 1;
        last = j;
        break;
      }
    }
  }
  cout << ans << endl;
}
