#include<cstdio>
#include<cctype>
using namespace std;
short a[1000010];int n,f;
inline int in()
{
char c;
while(!isdigit(c=getchar()));
int x=c-48;
while (isdigit(c=getchar()))
x=x*10+c-48;
return x;
}
int main()
{
#ifndef COGS
freopen("tickets.in","r",stdin);
freopen("tickets.out","w",stdout);
#endif // COGS
n=in();f=in();
int ans=0;
for (int i=1;i<=n;++i)
scanf("%hd",a+i);
for (int i=1;i<=n;++i)
{
int t=0,maxi=0;
for (int j=i;j<=n;++j)
{
t+=a[j];
if (t>f) {ans=ans<maxi?maxi:ans;break;}
else ++maxi;
}
if (ans>=f/2) {printf("%d",ans);return 0;}
}
printf("%d",ans);return 0;
}