class Array
    def accum
        inject([0]){|a, x| a + [a[-1] + x]}[1..-1]
    end
end

loop {
    n, k = gets.split.map &:to_i
    break if n == 0
    ac = [0] + (1..n).map { gets.to_i }.accum
    p (1..n-k+1).map{|i|
        ac[i+k-1] - ac[i-1]
    }.max
}