loop do
  n, k = gets.split.map(&:to_i)
  
  break if n == 0 && k == 0
  
  arr, ans, sum = [], -Float::INFINITY, 0

  n.times do |i|
    arr << gets.to_i
    
    sum += arr.last
    sum -= arr.shift if i >= k
    
    ans = [ans, sum].max
  end
  
  puts ans
end