loop do
  n, k = gets.split.map(&:to_i)
  break if (n|k) == 0

  sum = Array.new(n+1, 0)
  (1..n).each do |i|
    a = gets.to_i
    sum[i] = a + sum[i-1]
  end

  res = 0
  (1..n-k+1).each do |i|
    res = [res, sum[i+k-1] - sum[i-1]].max
  end

  puts res
end