#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 3;
int n, a[N];
long long pref[N], t, ans;
void calc(int l, int r) {
  if (l == r) {
    if (a[l] < t) ans++;
    return;
  }
  vector<long long> v;
  int md = (l + r) >> 1;
  for (int i = l; i <= md; i++) v.push_back(pref[i - 1]);
  sort(v.begin(), v.end());
  for (int i = md + 1; i <= r; i++) {
    int lo = 0, hi = (int)v.size() - 1;
    while (lo <= hi) {
      int mid = (lo + hi) >> 1;
      if (pref[i] < t + v[mid])
        hi = mid - 1;
      else
        lo = mid + 1;
    }
    hi++;
    ans += (int)v.size() - hi;
  }
  calc(l, md);
  calc(md + 1, r);
}
int main() {
  scanf("%d %I64d", &n, &t);
  for (int i = 1; i <= n; i++) {
    scanf("%d", a + i);
    pref[i] = pref[i - 1] + a[i];
  }
  calc(1, n);
  cout << ans << endl;
}
