#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int MAX = 1e5 + 5;
int a[MAX];
int main() {
  int w, l;
  while (scanf("%d %d", &w, &l) != EOF) {
    for (int i = 1; i <= w - 1; i++) {
      scanf("%d", &a[i]);
    }
    int res = INF;
    int sum = 0;
    for (int i = 1; i <= w - 1; i++) {
      if (i <= l) {
        sum += a[i];
      } else {
        res = min(res, sum);
        sum += a[i];
        sum -= a[i - l];
      }
    }
    res = min(res, sum);
    printf("%d\n", res);
  }
  return 0;
}
