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