#include <bits/stdc++.h>
using namespace std;
long long stone[111111];
int main() {
  long long w, l;
  scanf("%lld%lld", &w, &l);
  for (int i = 1; i <= w - 1; i++) scanf("%lld", &stone[i]);
  for (int i = 2; i <= w - 1; i++) {
    stone[i] += stone[i - 1];
  }
  long long dap = 1011111111;
  for (int i = l; i <= w - 1; i++) {
    dap = min(dap, stone[i] - stone[i - l]);
  }
  printf("%lld", dap);
}
