program tickets;
var n,f,i,j,s,maxn:longword;
max:int64;
a:array[1..1000000]of byte;
begin
assign(input,'tickets.in'); reset(input);
assign(output,'tickets.out'); rewrite(output);
readln(n,f);
for i:=1 to n do read(a[i]);
max:=0; maxn:=0;
for i:=1 to n do
begin
s:=0;
for j:=i to n do
begin
s:=s+a[j];
if s>f then
begin
if s-a[j]>max then begin max:=s-a[j]; maxn:=j-i; end;
break;
end;
end;
end;
writeln(maxn);
close(input); close(output);
end.