### main

n, k = gets.strip.split(' ').map{|s| s.to_i}

i = 0
max_sum = sum = 0
as = []

while i < k
  ai = gets.strip.to_i
  as << ai

  sum += ai

  i += 1
end

max_sum = sum

while i < n
  ai = gets.strip.to_i
  aj = as.shift
  as << ai

  sum += ai - aj
  max_sum = sum if max_sum < sum

  i += 1
end

puts max_sum