#include <bits/stdc++.h>
using namespace std;
long long int n, t;
long long int a[200005], p[200005];
vector<long long int> seg[4 * 200005];
void combine(long long int node) {
  long long int i = 0, j = 0;
  while (i < (long long int)seg[2 * node].size() and
         j < (long long int)seg[2 * node + 1].size()) {
    if (seg[2 * node][i] <= seg[2 * node + 1][j])
      seg[node].push_back(seg[2 * node][i]), i++;
    else
      seg[node].push_back(seg[2 * node + 1][j]), j++;
  }
  while (i < (long long int)seg[2 * node].size()) {
    seg[node].push_back(seg[2 * node][i]);
    i++;
  }
  while (j < (long long int)seg[2 * node + 1].size()) {
    seg[node].push_back(seg[2 * node + 1][j]);
    j++;
  }
}
void build(long long int node, long long int s, long long int e) {
  if (s == e) {
    seg[node].push_back(p[s]);
    return;
  }
  long long int mid = (s + e) / 2;
  build(2 * node, s, mid);
  build(2 * node + 1, mid + 1, e);
  combine(node);
}
long long int query(long long int node, long long int s, long long int e,
                    long long int l, long long int r, long long int val) {
  if (s > e or e < l or s > r) return 0;
  if (s >= l and e <= r) {
    long long int p1 =
        upper_bound(seg[node].begin(), seg[node].end(), val - t) -
        seg[node].begin();
    return (long long int)seg[node].size() - p1;
  }
  long long int mid = (s + e) / 2;
  return query(2 * node, s, mid, l, r, val) +
         query(2 * node + 1, mid + 1, e, l, r, val);
}
int main() {
  long long int i, j, k, ans = 0;
  cin >> n >> t;
  for (i = 1; i <= n; i++) cin >> a[i];
  for (i = 1; i <= n; i++) {
    p[i] = p[i - 1] + a[i];
  }
  build(1, 0, n);
  for (i = 1; i <= n; i++) {
    ans += query(1, 0, n, 0, i - 1, p[i]);
  }
  cout << ans << '\n';
}
