Little Dima has two sequences of points with integer coordinates: sequence (a1, 1), (a2, 2), ..., (an, n) and sequence (b1, 1), (b2, 2), ..., (bn, n).

Now Dima wants to count the number of distinct sequences of points of length 2·n that can be assembled from these sequences, such that the x-coordinates of points in the assembled sequence will not decrease. Help him with that. Note that each element of the initial sequences should be used exactly once in the assembled sequence.

Dima considers two assembled sequences (p1, q1), (p2, q2), ..., (p2·n, q2·n) and (x1, y1), (x2, y2), ..., (x2·n, y2·n) distinct, if there is such i (1 ≤ i ≤ 2·n), that (pi, qi) ≠ (xi, yi).

As the answer can be rather large, print the remainder from dividing the answer by number m.

Input

The first line contains integer n (1 ≤ n ≤ 105). The second line contains n integers a1, a2, ..., an (1 ≤ ai ≤ 109). The third line contains n integers b1, b2, ..., bn (1 ≤ bi ≤ 109). The numbers in the lines are separated by spaces.

The last line contains integer m (2 ≤ m ≤ 109 + 7).

Output

In the single line print the remainder after dividing the answer to the problem by number m. 

Examples

Input

1
1
2
7


Output

1


Input

2
1 2
2 3
11


Output

2

Note

In the first sample you can get only one sequence: (1, 1), (2, 1). 

In the second sample you can get such sequences : (1, 1), (2, 2), (2, 1), (3, 2); (1, 1), (2, 1), (2, 2), (3, 2). Thus, the answer is 2.
import java.util.*;
import java.io.*;
public class Main {
    public static void main(String[] args) throws Exception {
        FastScanner in = new FastScanner(System.in);
        int N = in.nextInt();
        int[] vals = new int[N+N];
        int interchange = 0;
        TreeMap<Integer,Integer> run = new TreeMap<Integer,Integer>();
        for (int i=0; i<N+N; i++) {
            vals[i] = in.nextInt();
            if (i>=N && vals[i-N]==vals[i])
                interchange++;
            if (!run.containsKey(vals[i]))
                run.put(vals[i],0);
            run.put(vals[i],run.get(vals[i])+1);
        }
        int m = in.nextInt();
        long[] fwo2 = new long[2*N+1];
        int[] tc = new int[2*N+1];
        fwo2[1] = 1;
        tc[1] = 0;
        for (int i=2; i<=2*N; i++) {
            int x = i;
            tc[i] = tc[i-1];
            while(x%2==0) {
                tc[i]++;
                x/=2;
            }
            fwo2[i] = (fwo2[i-1] * x)%m;
        }
        
        long ans = 1;
        for (int r: run.values()) {
            if (r<=1) continue;
            ans = (ans * fwo2[r])%m;
            interchange -= tc[r];
        }
        
        ans = (ans * modPow(2,-interchange,m))%m;
        System.out.println(ans);
    }
    static long modPow(long num, long pow, long mod) {
        if (pow < 0)
            return 0;
        if (pow == 0)
            return 1;
        if (pow == 1)
            return num;
        if (pow%2==0)
            return modPow((num*num)%mod,pow/2,mod);
        else
            return (modPow((num*num)%mod,pow/2,mod)*num)%mod;
    }
    
    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;
        
        FastScanner(InputStream in) throws Exception{
            br = new BufferedReader(new InputStreamReader(in));
            st = new StringTokenizer(br.readLine().trim());
        }
        public int numTokens() throws Exception {
            if(!st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine().trim());
                return numTokens();
            }
            return st.countTokens();
        }
        public String next() throws Exception {
            if(!st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine().trim());
                return next();
            }
            return st.nextToken();
        }
        public double nextDouble() throws Exception {
            return Double.parseDouble(next());
        }
        public long nextLong() throws Exception {
            return Long.parseLong(next());
        }
        public int nextInt() throws Exception {
            return Integer.parseInt(next());
        }
    }
}