#include <bits/stdc++.h>
using namespace std;
long long a[100005] = {0};
long long sum[100005] = {0};
long long n, t, mx = 0;
long long sumc(int l, int r) { return (r < l ? 0 : sum[r] - sum[l - 1]); }
bool isgood(long long x) {
  for (int l = 0, r = x - 1; r < n; ++l, ++r)
    if (sumc(l, r) <= t) return true;
  return false;
}
long long check(int low, int high) {
  if (low == high) {
    return low;
  }
  int mid = (low + high + 1) / 2;
  if (low == high - 1) {
    if (isgood(high)) {
      return high;
    }
    return low;
  } else {
    if (isgood(mid))
      check(mid, high);
    else
      check(low, mid - 1);
  }
}
int main() {
  cin >> n >> t;
  sum[-1] = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum[i] = a[i] + sum[i - 1];
  }
  mx = check(0, n);
  cout << mx << endl;
  return 0;
}
