from typing import Sequence


def solve(n: int, k: int, a: Sequence[int]) -> int:
    s = [0 for _ in range(n + 1)]
    for i in range(n):
        s[i + 1] = s[i] + a[i]
    ans = 0
    for i in range(n - k + 1):
        ans = max(ans, s[i + k] - s[i])
    return ans


while True:
    n, k = map(int, input().split())
    if not n and not k:
        break
    a = [int(input()) for _ in range(n)]
    print(solve(n, k, a))
