import std.stdio;

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

scanf("%d %d",&n,&k);

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

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;
}