program muffin;
{ constraints }
const
    MAXN = 1000000;

{ input data }
var
    N, K, i, Ans, sapore  : longint;
    V        : array[0..MAXN-1] of longint;

begin
{
    uncomment the following lines if you want to read/write from files
    assign(input,  'input.txt');  reset(input);
    assign(output, 'output.txt'); rewrite(output);
}

    readln(N, K);
    for i:=0 to N-1 do
        read(V[i]);
    readln; 
    sapore:=0; Ans:=0;
    for i:=0 to K-1 do sapore:=sapore+V[i]; 
    i:=K; Ans:=sapore;
    while i<N do
             begin
               sapore:=sapore-V[i-k]+V[i];
               if sapore>Ans then Ans:=sapore;
               i:=i+1;
             end;  

    writeln(Ans); { answer }
end.
