#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5;
int num[maxn + 1];
void solve(int n, int l) {
  int result, sum = 0;
  for (int i = 1; i <= l; ++i) sum += num[i];
  result = sum;
  for (int i = l + 1; i < n; ++i) {
    sum += num[i] - num[i - l];
    result = min(result, sum);
  }
  cout << result;
}
int main() {
  ios_base::sync_with_stdio(0);
  int n, l;
  cin >> n >> l;
  for (int i = 1; i < n; ++i) cin >> num[i];
  solve(n, l);
}
