Given are N integers A_1,\ldots,A_N.

We will choose exactly K of these elements. Find the maximum possible product of the chosen elements.

Then, print the maximum product modulo (10^9+7), using an integer between 0 and 10^9+6 (inclusive).

Constraints

* 1 \leq K \leq N \leq 2\times 10^5
* |A_i| \leq 10^9

Input

Input is given from Standard Input in the following format:


N K
A_1 \ldots A_N


Output

Print the maximum product modulo (10^9+7), using an integer between 0 and 10^9+6 (inclusive).

Examples

Input

4 2
1 2 -3 -4


Output

12


Input

4 3
-1 -2 -3 -4


Output

1000000001


Input

2 1
-1 1000000000


Output

1000000000


Input

10 10
1000000000 100000000 10000000 1000000 100000 10000 1000 100 10 1


Output

999983200
N, K = map(int, input().split())
X = list(map(int, input().split()))
MOD = 10 ** 9 + 7
 
pos = sorted(v for v in X if v >= 0)
neg = sorted(-v for v in X if v < 0)
if N == K:
    ans = 1
    for x in X:
        ans *= x
        ans %= MOD
    print(ans % MOD)
    exit()
ok = False  # True: ans>=0, False: ans<0
if pos:
    #正の数があるとき
    ok = True
else:
    #全部負-> Kが奇数なら負にならざるをえない。
    ok = (K % 2 == 0)
 
ans = 1
if ok:
    # ans >= 0
    if K % 2 == 1:
        #Kが奇数の場合初めに1つ正の数を掛けておく
        #こうすれば後に非負でも負でも2つずつのペアで
        #考えられる
        ans = ans * pos.pop() % MOD
 
    # 答えは非負になる→二つの数の積は必ず非負になる．
    cand = []
    while len(pos) >= 2:
        x = pos.pop() * pos.pop()
        cand.append(x)
 
    while len(neg) >= 2:
        x = neg.pop() * neg.pop()
        cand.append(x)
 
    cand.sort(reverse=True) # ペアの積が格納されているので必ず非負
    # ペア毎に掛けていく
    for i in range(K // 2):
        ans = ans * cand[i] % MOD
else:
    # ans <= 0
    cand = sorted(X, key=lambda x: abs(x))
    for i in range(K):
        ans = ans * cand[i] % MOD
 
print(ans)