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;

#define FOR(i, n) for(int i = 0; i < (int) n; i++)
#define PB push_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define F first
#define S second

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;

const int MOD = 1e9+7;
const int MAX = 1e5+7;

int main(){
	int n, k; cin >> n >> k;
	vi v(n); FOR(i, n) cin >> v[i];

	sort(all(v));

	ll ans = 1;
	if(v[0] >= 0){
		FOR(i, k){
			ans = ans * v[n-i-1] % MOD;
		}
	}else if(v[n-1] <= 0){
		if(k%2){
			FOR(i, k) ans = ans * v[n-i-1] % MOD;
		}else{
			FOR(i, k) ans = ans * v[i] % MOD;
		}
	}else{
		int l = 0, r = n-1;

		if(k%2){
			ans = ans * v[r] % MOD;
			r--;
			k--;
		}

		while(k){
			ll a1, a2;
			a1 = 1LL * v[l] * v[l+1];
			a2 = 1LL * v[r] * v[r-1];

			if(a1 > a2){
				a1 %= MOD;
				ans = ans * a1 % MOD;
				l+=2;
			}else{
				a2 %= MOD;
				ans = ans * a2 % MOD;
				r-=2;
			}

			k-=2;
		}
	}

	if(ans < 0) ans += MOD;
	
	cout << ans << endl;

	return 0;
}
