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
#include <bits/stdc++.h>
using namespace std;

int main() {
  ios::sync_with_stdio(false);

  const int M = 1e9 + 7;

  int N, K;
  cin >> N >> K;

  vector<int> A(N);
  for (int i = 0; i < N; ++i) cin >> A[i];
  sort(A.begin(), A.end());

  if (N == K || A.back() < 0) {
    int res = 1;
    for (int i = 0; i < K; ++i) res = (int64_t) res * (K & 1 ? A.rbegin()[i] : A.begin()[i]) % M;
    if (res < 0) res += M;
    cout << res << endl;
  } else {
    int res = 1;
    int i = 0, j = N - 1;
    if (K & 1) --K, res = A[j--];
    for (; K; K -= 2) {
      int64_t v0 = (int64_t) A[i] * A[i + 1];
      int64_t v1 = (int64_t) A[j] * A[j - 1];
      if (v0 > v1) res = (int64_t) res * (v0 % M) % M, i += 2;
      else res = (int64_t) res * (v1 % M) % M, j -= 2;
    }
    if (res < 0) res += M;
    cout << res << endl;
  }

  return 0;
}

