#include <bits/stdc++.h>
using namespace std;
const int N = int(1e5) + 100;
int n;
int t;
int a[N];
bool check(int val) {
  for (int i = 1; i <= n - val + 1; i++)
    if (a[i + val - 1] - a[i - 1] <= t) return true;
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> t;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    a[i] = a[i - 1] + x;
  }
  int lo = 0;
  int hi = n;
  int mid;
  while (lo < hi) {
    mid = lo + (hi - lo + 1) / 2;
    if (check(mid))
      lo = mid;
    else
      hi = mid - 1;
  }
  cout << lo;
  return 0;
}
