#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
const long long MAX = 2e14 + 10;
map<long long, int> mp;
long long lowbit(long long x) { return x & (-x); }
void add(long long x) {
  while (x <= 2LL * MAX) {
    mp[x]++;
    x += lowbit(x);
  }
  return;
}
long long GetSum(long long x) {
  long long ans = 0;
  while (x > 0) {
    ans += mp[x];
    x -= lowbit(x);
  }
  return ans;
}
long long a[maxn];
int main() {
  int n;
  long long t;
  scanf("%d%lld", &n, &t);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
    a[i] = a[i] + a[i - 1];
  }
  long long ans = 0;
  add(MAX);
  for (int i = 1; i <= n; i++) {
    long long tmp2 = GetSum(a[i] - t + MAX);
    ans += (i - tmp2);
    add(a[i] + MAX);
  }
  printf("%lld\n", ans);
  return 0;
}
