#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int n, t;
int arr[N];
int canWeRead(int mid) {
  for (int i = 1; i <= n - mid + 1; i++) {
    if ((arr[i + mid - 1] - arr[i - 1]) <= t) return 1;
  }
  return 0;
}
int binarySearch() {
  int lo = 0, mid, hi = n;
  while (lo < hi) {
    mid = (hi + lo + 1) / 2;
    if (canWeRead(mid))
      lo = mid;
    else
      hi = mid - 1;
  }
  return lo;
}
int main() {
  scanf("%d%d", &n, &t);
  for (int i = 1; i <= n; i++) {
    scanf("%d", arr + i);
    arr[i] += arr[i - 1];
  }
  printf("%d\n", binarySearch());
}
