#include <bits/stdc++.h>
using namespace std;
const long long maxn = 2e5 + 10;
long long n, t, ans, sum, cnt, rt;
struct node {
  long long v, pri, ls, rs, size;
} a[maxn];
inline long long news(long long x) {
  a[++cnt].v = x;
  a[cnt].pri = rand();
  a[cnt].size = 1;
  return cnt;
}
inline void pushup(long long x) {
  a[x].size = a[a[x].ls].size + a[a[x].rs].size + 1;
}
void merge(long long &x, long long l, long long r) {
  if (!l || !r) {
    x = l + r;
    return;
  }
  if (a[l].pri > a[r].pri)
    x = l, merge(a[x].rs, a[l].rs, r);
  else
    x = r, merge(a[x].ls, l, a[r].ls);
  pushup(x);
}
void split(long long x, long long &l, long long &r, long long val) {
  if (!x) {
    l = r = 0;
    return;
  }
  if (a[x].v <= val)
    l = x, split(a[x].rs, a[l].rs, r, val);
  else
    r = x, split(a[x].ls, l, a[r].ls, val);
  pushup(x);
}
void insert(long long val) {
  long long x, y, z = news(val);
  split(rt, x, y, val);
  merge(x, x, z), merge(rt, x, y);
}
void getrank(long long val) {
  long long x, y, ret;
  split(rt, x, y, val);
  ans += a[y].size;
  merge(rt, x, y);
}
signed main() {
  scanf("%lld%lld", &n, &t);
  insert(0);
  for (long long x, i = 1; i <= n; i++) {
    scanf("%lld", &x);
    getrank((sum += x) - t), insert(sum);
  }
  printf("%lld\n", ans);
  return 0;
}
