import scala.math._
import scala.collection.mutable.ListBuffer

object Main {
  //rt.gc()??§??¬??????????????¬?????????????????????
  //val rt = Runtime.getRuntime()
  val sc = new java.util.Scanner(System.in)
  def main(args: Array[String]) {
    while(true) {
      val n,k = sc.nextInt()
      if((n,k) == (0,0)) {
        return
      }

      val a = (1 to n).map(_ => sc.nextInt())
      var max = a.take(k).sum
      var tmp = max
      for(i <- 0 until n-k) {
        tmp = tmp + a(i+k) - a(i)
        if(max < tmp) {
          max = tmp
        }
      }
      println(max)
    }
  }
}