#include <bits/stdc++.h>
using namespace std;
int const N = 1e5 + 1;
vector<pair<int, int> > v;
long long a[N], b[N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long x, k, sum = 0;
  cin >> x >> k;
  for (int i = 0; i < (int)(x); ++i) cin >> a[i];
  int ans = 0;
  for (int i = 0; i < (int)(x); ++i) {
    sum += a[i];
    if (sum <= k && i != x - 1 || sum == k && i == x - 1)
      ans++;
    else
      sum -= a[i];
  }
  cout << ans << endl;
  return 0;
}
