
import std.stdio, std.algorithm, std.string, std.conv, std.array;

int read_num() {return readln.chomp.to!(int);}

void main() {
  while(true) {
    int[] line = readln.chomp.split(" ").map!(to!(int)).array;
    int times = line[0];
    int len = line[1];
    int[] arr;

    if (times == 0 && len == 0) break;
  
    foreach(t; 0..times)
      arr ~= read_num;

    int prev = arr[0];
    int max = prev;
    int sum = prev;
    int next = 0;
    foreach(x; arr[1..(max + 1)])
      max += x;
  
    sum = max;
    foreach(i; len..times) {
      next = arr[i];
      sum += next;
      sum -= prev;
      if (sum > max) max = sum;
      prev = next;
    }
    writeln(max);
  }
}