function Main(input) {
input = input.split("\n");
input[0] = input[0].split(" ").map(Number);
var arr = input[1].split(" ").map(Number);
var nowsum = 0;
var maxsum = 0;
for(var i=0;i<input[0][1];i++){
	nowsum += arr[i];
}
maxsum = nowsum;
var maxpoint = 0;
for(var j=input[0][1]-1;j<arr.length;j++){
 // console.log(j,nowsum,j-input[0][1]+1)
	nowsum -= arr[j-input[0][1]+1];
	nowsum += arr[j+1];
	if(maxsum<nowsum){
		maxsum= nowsum;
		maxpoint = j-input[0][1]+1;
	}
}
//console.log(maxsum)
  console.log((maxsum-0+input[0][1])/2)
}Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());