include[HTML_REMOVED]
using namespace std;
int n,s,a[100005],t,sum,mx;
int main(){
cin>>n>>t;
for(int i=1,j=1;i<=n;i++)
{
cin>>a[i];
sum+=a[i];
s++;
while(sum>t)
{
sum-=a[j];
j++;
s--;
}
mx=max(s,mx);
//cout<<s<<endl;
}
cout<<mx;
return 0;
}