965_D. Single-use Stones
A lot of frogs want to cross a river. A river is w units width, but frogs can only jump l units long, where l < w. Frogs can also jump on lengths shorter than l. but can't jump longer. Hopefully, there are some stones in the river to help them.

The stones are located at integer distances from the banks. There are a_i stones at the distance of i units from the bank the frogs are currently at. Each stone can only be used once by one frog, after that it drowns in the water.

What is the maximum number of frogs that can cross the river, given that then can only jump on the stones?

Input

The first line contains two integers w and l (1 ≤ l < w ≤ 10^5) — the width of the river and the maximum length of a frog's jump.

The second line contains w - 1 integers a_1, a_2, …, a_{w-1} (0 ≤ a_i ≤ 10^4), where a_i is the number of stones at the distance i from the bank the frogs are currently at.

Output

Print a single integer — the maximum number of frogs that can cross the river.

Examples

Input

10 5
0 0 1 0 2 0 0 1 0


Output

3


Input

10 3
1 1 1 1 2 1 1 1 1


Output

3

Note

In the first sample two frogs can use the different stones at the distance 5, and one frog can use the stones at the distances 3 and then 8.

In the second sample although there are two stones at the distance 5, that does not help. The three paths are: 0 → 3 → 6 → 9 → 10, 0 → 2 → 5 → 8 → 10, 0 → 1 → 4 → 7 → 10.
```python
w, l = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
s = res = sum(a[:l])
for i in range(l, w - 1):
    s += a[i] - a[i - l]
    res = min(res, s)
print(res)
    
```