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<stdio.h>
#include<algorithm>
using namespace std;
const long long mod=1e9+7;
long long a[200010];
long long a1[200010];
int main()
{
    int n,k;
    scanf("%d%d",&n,&k);
    for(int i=0;i<n;i++)scanf("%lld",&a[i]);
    sort(a,a+n);
    long long ans=1;
    if(a[0]>=0)for(int i=1;i<=k;i++)ans=(ans*a[n-i])%mod;
    else if(a[n-1]<=0&&(k%2)==0)for(int i=0;i<k;i+=2)ans=a[i]*a[i+1]%mod*ans%mod;
    else if(a[n-1]<=0&&(k%2)==1)
    {
    	ans=(a[n-1]+mod)%mod;
    	for(int i=1;i<k;i+=2)ans=a[n-1-i]*a[n-2-i]%mod*ans%mod;
	}
	else if(n==k)for(int i=0;i<n;i++)
	{
		if(a[i]<0)a[i]+=mod;
		ans=ans*a[i]%mod;
	}
    else
    {
    	int n0=0,n1=0,n2=0;
    	for(int i=0;i<n;i++)
    	{
    		if(a[i]<0)n2++;
    		else if(a[i]==0)n0++;
    		else if(a[i]>0)n1++;
		}
		if(n1+n2<k)ans=0;
		else if((n2%2)==1&&n1+n2==k&&n0)ans=0;
		else
		{
			for(int i=0;i<n1;i++)a1[i]=a[n-i-1];
			int na1=0,na2=0;
			if(k<=n1)na1=k;
			else
			{
				na1=n1;
				if(((k-n1)%2)==1)na1--;
				na2=k-na1;
			}
			while(na1>1&&na2+1<n2&&(a1[na1-1]*a1[na1-2])<((a[na2])*(a[na2+1])))na1-=2,na2+=2;
			for(int i=0;i<na1;i++)ans=ans*a1[i]%mod;
			for(int i=0;i<na2;i++)ans=ans*(a[i]+mod)%mod;
		}
	}
	printf("%lld\n",ans);
    return 0;
}