#include <bits/stdc++.h>
using namespace std;
const int SI = 1e5 + 1000;
int n, l;
int a[SI];
int ans[SI];
int main() {
  scanf("%d %d", &n, &l);
  for (int i = 1; i < n; i++) scanf("%d", &a[i]);
  a[0] = a[n] = 1e9 + 1;
  ans[0] = 1e9 + 1;
  int need = 1;
  for (int i = 0; i < n; i++) {
    need = ((need) > (i + 1) ? (need) : (i + 1));
    while (ans[i] > 0 && need - i <= l) {
      int ee =
          ((ans[i]) < (a[need] - ans[need]) ? (ans[i]) : (a[need] - ans[need]));
      ans[i] -= ee;
      ans[need] += ee;
      if (ans[need] == a[need]) need++;
    }
  }
  int res = 0;
  printf("%d", ans[n]);
  return 0;
}
