import std.stdio;

int main(string[] args){
int n,k,max=0;
int val;
int sumArray[1000003];

while(scanf("%d %d",&n,&k)!=EOF){

for(int i=0;i<n;i++){
  scanf("%d",&val);
    if(i == 0)sumArray[i]=val;
    else sumArray[i]=sumArray[i-1]+val;
}

max = sumArray[k-1];
for(int i=k;i<n;i++){
  if(sumArray[i]-sumArray[i-k] > max)max=sumArray[i]-sumArray[i-k];
}

writeln(max);
}
return 0;
}