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
import java.util.*;

public class Main {


    public static void main(String[] args){

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int k = sc.nextInt();
        List<Integer> pos = new ArrayList<>();
        List<Integer> neg = new ArrayList<>();
        List<Integer> all = new ArrayList<>();
        int zn = 0;
        for(int i=0; i<n; i++) {
            int num = sc.nextInt();
            if(num == 0) {
                zn++;
                all.add(0);
            } else if(num > 0) {
                pos.add(num);
                all.add(num);
            } else {
                neg.add(-num);
                all.add(-num);
            }
        }
        int pn = pos.size();
        int nn = neg.size();
        Collections.sort(pos, Comparator.reverseOrder());
        Collections.sort(neg, Comparator.reverseOrder());
        Collections.sort(all);
        long[] pa = new long[pn];
        long[] na = new long[nn];

        for(int i=0; i<pn; i++) {
            pa[i] = pos.get(i);
        }
        for(int i=0; i<nn; i++) {
            na[i] = neg.get(i);
        }

        if(pn + nn < k) {
            System.out.println(0);
            return;
        }

        if( k % 2 == 0 ) {
            int a = Math.min(pn - pn%2, k);
            int b = k - a;
            if(b > nn) {
                System.out.println(min(all, k));
                return;
            }
            int ma = a;
            int mb = b;
            while(true) {
                if(a >= 2 && b+2<=nn && pa[a-1]*pa[a-2] < na[b]*na[b+1]) {
                    a-=2;
                    b+=2;
                    ma = a;
                    mb = b;
                } else {
                    break;
                }
            }
            System.out.println(calc(pa, na, ma, mb));
        } else {
            int a = pn;
            if(pn %2 == 0) {
                a--;
            }
            a = Math.min(a, k);
            int b = k-a;
            if(a < 0 || b > nn) {
                System.out.println(min(all, k));
                return;
            }
            int ma = a;
            int mb = b;
            while(true) {
                if(a >= 2 && b+2<=nn && pa[a-1]*pa[a-2] < na[b]*na[b+1]) {
                    a-=2;
                    b+=2;
                    ma = a;
                    mb = b;
                } else {
                    break;
                }
            }
            System.out.println(calc(pa, na, ma, mb));

        }


    }
    static long mod = 1000000007;
    static long min(List<Integer> list, int k) {
        long res = 1;
        for(int i=0; i<k; i++) {
            res *= list.get(i);
            res %= mod;
        }
        if(res > 0) {
            res = (mod - res) % mod;
        }

        return res;

    }
    static long calc(long[] pa, long[] na, int a, int b) {
        long res = 1;
        for(int i=0; i<a; i++) {
            res *= pa[i];
            res %= mod;
        }
        for(int i=0; i<b; i++) {
            res *= na[i];
            res %= mod;
        }
        return res;
    }


}