#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
const int inf = 0x3f3f3f3f;
int a[maxn], b[maxn];
int main() {
  int w, l, i, sum = inf;
  cin >> w >> l;
  for (i = 1; i < w; i++) {
    scanf("%d", &a[i]);
    b[i] = b[i - 1] + a[i];
  }
  for (i = l; i < w; i++) {
    sum = min(sum, b[i] - b[i - l]);
  }
  printf("%d\n", sum);
  return 0;
}
