#include <bits/stdc++.h>
int main(void) {
  int n, k, sum, max, i, o, line[100000];
  for (; max = -30000, sum = 0, scanf("%d %d", &n, &k), k;) {
    for (i = 0; i < n; i++) scanf("%d", &line[i]);
    for (i = 0; i < k; i++) sum += line[i];
    for (i = 1; i <= n - k; i++) {
      sum -= line[i - 1];
      sum += line[i + k - 1];
      if (sum > max) max = sum;
    }
    printf("%d\n", max);
  }
  return 0;
}
