#include<bits/stdc++.h>
#define int long long
using namespace std;
constexpr int mod=1e9+7;
signed main(){
    int n,k,a[100000],ans=0,sum=0;
    while(cin>>n>>k,n||k){
    ans=0,sum=0;
    for(int i=0;i<n;i++){
        cin>>a[i];
        sum+=a[i];
        if(i>=k)
            sum-=a[i-k];
        if(i>=k-1)
            ans=max(ans,sum);
    }
    cout<<ans<<endl;}
}

