#include <bits/stdc++.h>
using namespace std;
inline bool equal(double _x, double _y) {
  return _x > _y - 1e-9 && _x < _y + 1e-9;
}
int a[100005], ans;
map<int, int> mp;
int main() {
  int w, l, tmp;
  cin >> w >> l;
  a[0] = 1e9;
  for (int i = 1; i < w; i++) {
    scanf("%d", &tmp);
    mp[i] = tmp;
  }
  for (int i = 0; i < w; i++) {
    if (i + l >= w) {
      ans += a[i];
      continue;
    }
    if (mp.empty()) continue;
    auto it = mp.lower_bound(i + 1 + l);
    if (it == mp.begin()) continue;
    it--;
    while (it->first > i) {
      int id = it->first;
      bool f = (it == mp.begin() ? 1 : 0);
      a[id] += min(mp[id], a[i]);
      it--;
      if (mp[id] > a[i]) {
        mp[id] -= a[i];
        a[i] = 0;
      } else {
        a[i] -= mp[id];
        mp.erase(id);
      }
      if (f || a[i] == 0) break;
    }
  }
  printf("%d\n", ans);
}
