int main(){
    int N, X;
  cin >> N >> X;
  vector <int> a(N);
  rep(i, N){
    cin >> a[i];
  }
  
   int sum = accumulate(a.begin(),a.end(),0);
    
  if(X == sum){
    cout << N << endl;
  }
  else if(X > sum){
    cout << N - 1 << endl;
  }
  
  else{
      int sum1 = accumulate(a.begin(),a.begin()+1,0);
      int sum2 = accumulate(a.begin()+1,a.begin(),0);
      int sum3 = accumulate(a[0],a[2],0);
    rep(i,N){
      
      }
    }
  }