
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[100000] arr;

    if (times == 0 && len == 0) break;
  
    foreach(i; 0..times)
      arr[i] = read_num;

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