#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;
const int MAX_NODES = MX * 50;
struct Trie {
  int sz;
  int t[MAX_NODES][2], cnt[MAX_NODES][2];
  Trie() {
    memset(t, 0xff, sizeof t);
    memset(cnt, 0, sizeof cnt);
    sz = 0;
  }
  void insert(long long x) {
    int node = 0;
    for (int i = 49; i >= 0; --i) {
      int bit = (x >> i) & 1;
      if (t[node][bit] == -1) t[node][bit] = ++sz;
      ++cnt[node][bit];
      node = t[node][bit];
    }
  }
  int find(long long x) {
    int node = 0;
    int res = 0;
    for (int i = 49; i >= 0; --i) {
      int bit = (x >> i) & 1;
      if (node == -1) return res;
      if (!bit) res += cnt[node][bit ^ 1];
      node = t[node][bit];
    }
    return res;
  }
} trie;
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)) + abs(k);
  trie.insert(shift);
  long long res = 0;
  for (int i = 0; i < n; ++i) {
    int here = trie.find(a[i] - k + shift);
    res += here;
    trie.insert(a[i] + shift);
  }
  cout << res << '\n';
  return 0;
}
