#include <bits/stdc++.h>
using namespace std;
int n,k,a[10005],sum,b[10005];
void work()
{
cin>>n;
cin>>k;
for(int i=1;i<=n;i++){
cin>>a[i];
b[i]=b[i-1]+a[i];
}
for(int i=k+1;i<=n;i++){
sum=max(sum,b[i]-b[i-k-1]);
}
cout<<sum;
return;
}
int main(){
work();
return 0;
}