module Main where
import Control.Monad
import Control.Applicative
import Data.Maybe
import Data.List
import qualified Text.Printf
import qualified Data.ByteString.Char8 as BC
import qualified Data.ByteString as BC

import qualified Data.Array as Arr

------------------------------------------

main :: IO ()
main = do
  [n, k] <- readInts
  if n == 0 && k == 0 then return ()
  else do
  arr <- Arr.listArray (0, n-1) <$> replicateM n readInt
  let s0 = foldl' (\acc idx -> acc + (arr Arr.! idx)) 0 [0..k-1]
      f (cand, prv) idx = let cand' = prv - (arr Arr.! idx) + (arr Arr.! (idx+k))
                          in (max cand cand', cand')
  let ans = fst $ foldl' f (s0, s0) [0..n-k-1]
  print ans
  main

------------------------------------------

{- Int input -}

parseInt :: BC.ByteString -> Int
parseInt = fst . fromJust . BC.readInt

parseInts :: BC.ByteString -> [Int]
parseInts = map parseInt <$> BC.words

readInt :: IO Int
readInt = parseInt <$> BC.getLine

readInts :: IO [Int]
readInts = parseInts <$> BC.getLine

{- Double Formatting -}

doubleFmt :: Double -> String
doubleFmt = Text.Printf.printf "%.12f"