Question
One Override Order Selection

An Amazon fulfillment center has n orders arranged in a fixed line.

The reward for processing order i is a_i.

The manager wants to process exactly k orders.

Normally, no two selected orders can be adjacent. However, the manager has one special override.

The override allows at most one adjacent selected pair in the final selection.

Your task is to find the maximum total reward possible by selecting exactly k orders with at most one adjacent selected pair.

If it is impossible to select exactly k valid orders, print -1.

Input

The first line contains two integers KaTeX can only parse string typed expression and KaTeX can only parse string typed expression — the number of orders and the number of orders to select.

The second line contains KaTeX can only parse string typed expression integers KaTeX can only parse string typed expression — the reward of each order.

Output

Print a single integer — the maximum total reward possible. If it is impossible to select exactly KaTeX can only parse string typed expression valid orders, print KaTeX can only parse string typed expression.

Example
Example 1:
Input
6 3

5 100 100 1 1 50
Output
250
Explanation
Select orders KaTeX can only parse string typed expression, KaTeX can only parse string typed expression, and KaTeX can only parse string typed expression. Orders KaTeX can only parse string typed expression and KaTeX can only parse string typed expression form one adjacent selected pair, which is allowed by the override. The total reward is KaTeX can only parse string typed expression.

Example 2:
Input
5 3

10 1 10 1 10
Output
30
Explanation
Select orders KaTeX can only parse string typed expression, KaTeX can only parse string typed expression, and KaTeX can only parse string typed expression. There are no adjacent selected pairs, so the override is not needed. The total reward is KaTeX can only parse string typed expression.

Example 3:
Input
3 3

4 5 6
Output
-1
Explanation
Selecting all three orders creates two adjacent selected pairs: KaTeX can only parse string typed expression with KaTeX can only parse string typed expression, and KaTeX can only parse string typed expression with KaTeX can only parse string typed expression. Since only one adjacent pair is allowed, it is impossible.

Online