#include <bits/stdc++.h>
using namespace std;
signed main() {
  std ::ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, s, ans = 0;
  cin >> n >> s;
  vector<long long> v(n);
  for (long long i = 0; i < n; i++) cin >> v[i];
  for (long long i = 0; i < n; i++) {
    long long sum = v[i];
    if (sum >= s) ans++;
    for (long long j = i + 1; j < n; j++) {
      sum += v[j];
      if (sum >= s) ans += (j - i);
    }
  }
  cout << ans;
}
