loop do
  n,k = gets.split(" ").map(&:to_i)
  break if n == 0 && k == 0
  a = Array.new(n) {gets.to_i}
  sum = 0
  0.upto(k-1) {|i| sum += a[i]}
  max = sum

  (k).upto(n-1) do |i|
    sum -= a[i-k]
    sum += a[i]
    max = sum if max < sum
  end

  puts max
end