#include <bits/stdc++.h>
using namespace std;
inline void prep() {
  cin.tie(0);
  cin.sync_with_stdio(0);
};
const int mod = (int)1e9 + 7;
const int MX = (int)2e5 + 10;
struct node {
  node* lf;
  node* rg;
  int cnt = 0;
};
void insert(long long x, node* cur) {
  for (int i = 55; i >= 0; --i) {
    int val = (x >> i) & 1;
    ;
    if (val == 0) {
      if (cur->lf == 0) cur->lf = new node();
      cur = cur->lf;
      cur->cnt++;
    } else {
      if (cur->rg == 0) cur->rg = new node();
      cur = cur->rg;
      cur->cnt++;
    }
  }
}
int query(long long x, node* cur) {
  int res = 0;
  for (int i = 55; i >= 0; --i) {
    int val = (x >> i) & 1;
    if (val == 0) {
      if (cur->rg) res += cur->rg->cnt;
      if (cur->lf == 0) break;
      cur = cur->lf;
    } else {
      if (cur->rg == 0) break;
      cur = cur->rg;
    }
  }
  return res;
}
int main() {
  prep();
  int n;
  long long k;
  cin >> n >> k;
  long long a[n];
  for (int i = 0; i < n; ++i) cin >> a[i];
  partial_sum(a, a + n, a);
  long long shift = abs(*min_element(a, a + n));
  for (int i = 0; i < n; ++i) {
    long long here = a[i] - k;
    if (here < 0) shift = max(shift, -here);
  }
  node* root = new node();
  insert(shift, root);
  long long res = 0;
  for (int i = 0; i < n; ++i) {
    int here = query(a[i] - k + shift, root);
    res += here;
    insert(a[i] + shift, root);
  }
  cout << res << '\n';
  return 0;
}
