#include <bits/stdc++.h>
int main() {
  int w, l;
  scanf("%d%d", &w, &l);
  std::vector<int> a(w);
  for (int i = 1; i < w; ++i) scanf("%d", &a[i]);
  for (int i = 1; i < w; ++i) a[i] += a[i - 1];
  int result = INT_MAX;
  for (int i = l; i < w; ++i) result = std::min(result, a[i] - a[i - l]);
  printf("%d\n", result);
}
