#include <bits/stdc++.h>
using namespace std;
int main() {
  int w, l;
  cin >> w >> l;
  int a[w + 1];
  a[0] = 0;
  a[w] = 0;
  for (int i = 1; i < w; i++) cin >> a[i];
  int ans = 1000000005;
  int cur = 0;
  for (int i = 1; i <= l; i++) cur += a[i];
  if (cur < ans) ans = cur;
  for (int i = l + 1; i < w; i++) {
    cur += a[i] - a[i - l];
    if (cur < ans) ans = cur;
  }
  cout << ans;
}
