while true
    n, k = gets.chomp.split.map(&:to_i)
    break if [n, k] == [0, 0]
    arr = []
    n.times{arr << gets.to_i}
    cum = [0]
    n.times{|i| cum[i + 1] = cum[i] + arr[i]}
    max = cum[k] - cum[0]
    (k + 1).upto(n){|i| max = cum[i] - cum[i - k] if max < cum[i] - cum[i - k]}
    puts max
end
