#include <bits/stdc++.h>
template <class T>
using pt = std::pair<T, T>;
using namespace std;
struct hoba {
  hoba *l, *r;
  int lf, rg;
  vector<long long> ar;
  hoba(int l, int r) : lf(l), rg(r) {}
};
vector<long long> a;
hoba *build(int l, int r) {
  hoba *root = new hoba(l, r);
  if (l == r) {
    root->ar.push_back(a[l]);
    return root;
  }
  root->l = build(l, (r + l) / 2);
  root->r = build((r + l) / 2 + 1, r);
  root->ar.resize(root->l->ar.size() + root->r->ar.size());
  merge(root->l->ar.begin(), root->l->ar.end(), root->r->ar.begin(),
        root->r->ar.end(), root->ar.begin());
  return root;
}
long long que(hoba *root, int l, int r, long long val) {
  if (root->lf > r || root->rg < l) return 0;
  if (root->lf >= l)
    return lower_bound(root->ar.begin(), root->ar.end(), val) -
           root->ar.begin();
  long long ansl = que(root->l, l, r, val);
  long long ansr = que(root->r, l, r, val);
  return ansl + ansr;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  long long t;
  cin >> n >> t;
  a.resize(n);
  cin >> a[0];
  for (int i = 1; i < n; i++) {
    cin >> a[i];
    a[i] += a[i - 1];
  }
  hoba *tree = build(0, a.size() - 1);
  long long cnt = 0, pref = 0;
  for (int i = 0; i < n; i++) {
    cnt += que(tree, i, n - 1, pref + t);
    pref = a[i];
  }
  cout << cnt;
  return 0;
}
