#include<stdio.h>
#define MAX 100000




int main(){
int n,i,s,j;
int sum=0;
int t;
int A[MAX];
int X[2][MAX];

scanf("%d %d",&n,&s);
for(i=0;i<n;i++){
 scanf("%d",&A[i]);
 sum+=A[i];
 X[0][i]=A[i];
 X[1][i]=A[i];
 if(A[i]>=s)t=1;
}

if(t!=1){

 if(sum<s){t=0;}
 else if(sum==s){t=n;}
 else{


  for(i=1;i<n;i++){
   for(j=0;j<n-i;j++){
    X[1][j]=X[1][j]+X[0][j+i];
    if(X[1][j]>=s){t=i+1;break;}
   }
   if(X[1][j]>=s){break;}
  }

 }
}

printf("%d\n",t);

return 0;
}
