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<iostream>
#include<algorithm>
#include<vector>
using namespace std;
const int MOD = 1000000007;
int main(){
	long long int N,K,A,M,pI,mI,ans=1;
	vector<long long int> p,m;
	cin>>N>>K;
	for(int i=0;i<N;i++){
		cin>>A;
		if(A<0)m.push_back(-A);
		else p.push_back(A);
	}
	sort(p.begin(),p.end());
	sort(m.begin(),m.end());
	if(p.size()==0 && K%2){
		for(int i=0;i<K;i++)ans=((-ans*m[i])%MOD+MOD)%MOD;
	}else{
		pI=p.size()-1;
		mI=m.size()-1;
		if(K%2){
			ans=p[pI]%MOD;
			pI--;K--;
		}
		for(int i=0;i<K/2;i++){
			if(mI-1<0 && pI-1<0){M=-p[0]*m[0]%MOD;}
			else if(mI-1<0){M=p[pI]*p[pI-1]%MOD;pI-=2;}
			else if(pI-1<0){M=m[mI]*m[mI-1]%MOD;mI-=2;}
			else if(p[pI]*p[pI-1]>=m[mI]*m[mI-1]){M=p[pI]*p[pI-1]%MOD;pI-=2;}
			else {M=m[mI]*m[mI-1]%MOD;mI-=2;}
			ans=(ans*M%MOD+MOD)%MOD;
		}
	}
	cout<<ans;
	return 0;
}
