//Still a time limit
#include <iostream>
#include <limits>
using namespace std;
int getSum(int sequence[], int s, int n){
int min = numeric_limits<int>::max();
for(int i = 0; i < n; i++){
int sum = 0;
for(int j = i; j < n; j++){
sum += sequence[j];
// cout << "At i = " << i << " and j = " << j << " sum is " << sum << endl;
if(sum >= s && (j - i) + 1 <= min){
min = (j - i) + 1;
}
}
}
return min;
}
int main(){
int n, s, num;
while(cin >> n >> s){
int sequence[n];
for(int i = 0; i < n; i++){
cin >> num;
sequence[i] = num;
}
int sum = getSum(sequence, s, n);
if(sum == numeric_limits<int>::max()){
cout << 0 << endl;
} else {
cout << sum << endl;
}
}
return 0;
}