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.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;

public class Main {
    static final FS sc = new FS();  // 封装输入类
    static final PrintWriter pw = new PrintWriter(System.out);
    static final int e97 = (int)1e9 + 7;

    public static void main(String[] args) {
        int n = sc.nextInt(), k = sc.nextInt();
        long[] a = new long[n];
        for (int i = 0;i < n;i++) {
            a[i] = sc.nextLong();
        }
        Arrays.sort(a);

        if(n == k){
            long ans =1;
            for(long e: a){
                ans = (e * ans) % e97;
            }
            ans += e97;
            ans %= e97;
            System.out.println(ans);
            return;
        }

        int negCount = 0, zeroCount =0;
        for(int i = 0; i < n; i++){
            if(a[i]<0) negCount++;
            else if(a[i] == 0) zeroCount++;
            else break;
        }
        int posCount = n - negCount - zeroCount;

        if(zeroCount > (n - k)){
            System.out.println(0);
            return;
        }
        if((zeroCount == (n - k)) && (negCount % 2 == 1)){
            System.out.println(0);
            return;
        }

        if((posCount == 0) && (k % 2 == 1)){
            if(zeroCount > 0){
                System.out.println(0);
            } else {
                long ans =1;
                for(int i = n - 1; i >= n - k; i--){
                    ans = (a[i] * ans) % e97;
                }
                ans += e97;
                ans %= e97;
                System.out.println(ans);
            }
            return;
        }

        long ans = 1;

        List<Long> multiPair = new ArrayList<>();
        for(int i = 1; i < negCount; i += 2){
            multiPair.add(a[i-1] * a[i]);
        }

        int lastPos = n;
        if(k % 2 == 0){
            lastPos -= 2;
        } else {
            ans = a[n-1];
            lastPos -= 3;
        }

        while(lastPos >= (zeroCount + negCount)){
            multiPair.add(a[lastPos] * a[lastPos + 1]);
            lastPos -= 2;
        }

        multiPair.sort(Comparator.reverseOrder());
        for(int i = 0; i < k / 2; i++){
            long addi = multiPair.get(i) % e97;
            ans *= addi;
            ans %= e97;
        }

        if(ans < 0) {
            ans += e97;
        }
        pw.println(ans);
        pw.flush();
    }

    static class FS {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer("");
        String next() {
            while(!st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch(Exception ignored) {}
            }
            return st.nextToken();
        }
        int[] nextArray(int n) {
            int[] a = new int[n];
            for(int i = 0;i < n;i++) {
                a[i] = nextInt();
            }
            return a;
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        long nextLong() {
            return Long.parseLong(next());
        }
    }
}