while true
  n, k = gets.split.map(&:to_i)
  break if n == 0
  a = []
  n.times{|i|
    a.push(gets.to_i)
  }
  sum = 0
  k.times{|i|
    sum += a[i]
  }
  ans = sum
  k.upto(n-1){|i|
    sum += a[i]
    sum -= a[i-k]
    ans = [ans, sum].max
  }
  p ans
end