#include <bits/stdc++.h>
using namespace std;
const int maxN = 2e5 + 8, MOD = 1e9 + 7;
struct Node {
  long long vl = 0;
  Node *le = NULL, *ri = NULL;
  Node() {}
} repo[maxN * 60];
int repc = 0;
Node *newNode() { return &repo[repc++]; }
Node *insert(long long w, long long l, long long r, Node *nd) {
  if (l <= w && w < r) {
    if (!nd) nd = newNode();
    nd->vl++;
    if (l + 1 < r) {
      long long m = (l + r) / 2;
      nd->le = insert(w, l, m, nd->le);
      nd->ri = insert(w, m, r, nd->ri);
    }
  }
  return nd;
}
long long query(long long l, long long r, long long u, long long v, Node *nd) {
  if (r <= u || v <= l || !nd) return 0;
  if (u <= l && r <= v) return nd->vl;
  long long m = (l + r) / 2;
  return query(l, m, u, v, nd->le) + query(m, r, u, v, nd->ri);
}
int n;
long long arr[maxN], t;
long long LIMI = 2e16 + 9;
long long rela = 0;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  cin >> n >> t;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  long long ans = 0, acum = 0;
  Node *tree = NULL;
  for (int i = n - 1; i >= 0; i--) {
    tree = insert(rela, -LIMI, LIMI, tree);
    rela -= arr[i];
    ans += query(-LIMI, LIMI, -LIMI, t + rela, tree);
  }
  cout << ans << '\n';
}
