#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100 + 10;
long long a[MAXN];
int main() {
  int N, x;
  bool pd = false;
  long long sum = 0, num = 0, maxl = -100;
  cin >> N >> x;
  for (int i = 1; i <= N; i++) cin >> a[i];
  for (int i = 1; i <= N; i++) {
    if (pd) break;
    num = 0;
    sum = 0;
    for (int j = i; j <= N; j++) {
      sum += a[j];
      num++;
      if (sum > x) {
        sum -= a[j];
        j++;
        num--;
        maxl = max(maxl, num);
      } else if (sum == x) {
        if (maxl < num) maxl = num;
        break;
      } else if (num == N && sum < x) {
        maxl = N - 1;
        pd = true;
        break;
      }
    }
  }
  cout << maxl;
  return 0;
}
