#include <bits/stdc++.h>
using namespace std;
int func(vector<int> &num,int s){
if(num[0] > s)
return 0;
int n = num.size();
vector<int> dp(n + 1,0);
dp[1] = num[0];
for(auto i = 2;i<n+1;++i)
dp[i] = dp[i-1] + num[i-1];
for(auto i = 1;i < n+1;++i){
if(dp[i] <= s && dp[i+1] > s)
return i;
}
return n;
}
int main(){
int n,s;
while(cin >> n >> s){
vector<int> num(n);
for(auto i = 0;i < n;++i)
cin>>num[i];
cout<<func(num,s)<<endl;
}
return 0;
}