#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
using namespace std;
const long long int N = 200043;
const long long int MOD = 1000000007;
long long int add(long long int x, long long int y) {
  x = ((x % MOD) + (y % MOD)) % MOD;
  while (x >= MOD) x -= MOD;
  while (x < 0) x += MOD;
  return x;
}
long long int mul(long long int x, long long int y) {
  return ((x % MOD) * (y % MOD)) % MOD;
}
long long int binpow(long long int x, long long int y) {
  long long int z = 1;
  while (y) {
    if (y & 1) z = mul(z, x);
    x = mul(x, x);
    y >>= 1;
  }
  return z;
}
long long int inv(long long int x) { return binpow(x, MOD - 2); }
long long int divide(long long int x, long long int y) {
  return mul(x, inv(y));
}
vector<long long int> tree[5 * N];
long long int A[N];
void build_tree(long long int cur, long long int l, long long int r) {
  if (l == r) {
    tree[cur].push_back(A[l]);
    return;
  }
  long long int mid = l + (r - l) / 2;
  build_tree(2 * cur, l, mid);
  build_tree(2 * cur + 1, mid + 1, r);
  long long int i = 0, j = 0;
  while (i < tree[2 * cur].size() && j < tree[2 * cur + 1].size()) {
    if (tree[2 * cur][i] < tree[2 * cur + 1][j])
      tree[cur].push_back(tree[2 * cur][i]), i++;
    else
      tree[cur].push_back(tree[2 * cur + 1][j]), j++;
  }
  while (i < tree[2 * cur].size()) tree[cur].push_back(tree[2 * cur][i]), i++;
  while (j < tree[2 * cur + 1].size())
    tree[cur].push_back(tree[2 * cur + 1][j]), j++;
}
long long int query(long long int cur, long long int l, long long int r,
                    long long int x, long long int y, long long int k) {
  if (r < x || l > y) {
    return 0;
  }
  if (x <= l && r <= y) {
    return lower_bound(tree[cur].begin(), tree[cur].end(), k) -
           tree[cur].begin();
  }
  long long int mid = l + (r - l) / 2;
  return query(2 * cur, l, mid, x, y, k) +
         query(2 * cur + 1, mid + 1, r, x, y, k);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t, i, j;
  t = 1;
  while (t--) {
    long long int n, k;
    cin >> n >> k;
    long long int ar[n + 1];
    for (i = 1; i <= n; i++) cin >> ar[i], A[i + 1] = A[i] + ar[i];
    cout << endl;
    build_tree(1, 1, n + 1);
    long long int ans = 0;
    for (i = 1; i < n + 1; i++) {
      long long int c = k + A[i];
      ans = ans + query(1, 1, n + 1, i + 1, n + 1, c);
    }
    cout << ans << endl;
  }
}
