loop do
  n, k = gets.split.map(&:to_i)
  
  break if n == 0 && k == 0
  
  arr, ans = [], 0
  
  n.times do
   arr << gets.to_i
  end
  
  (n - k + 1).times do |i|
    sum = 0
    
    k.times do |j|
      sum += arr[i + j]
    end
    
    ans = [ans, sum].max
  end
  
  puts ans
end