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 implements Runnable {
        class Point implements Comparable<Point>{
            int x, y;
            Point(int x, int y){
                this.x = x;
                this.y = y;
            }
            @Override
            public int compareTo(Point b){
                if(x != b.x) return x - b.x;
                else return y - b.y;
            }
        }
	public void solve() throws IOException {
		int N = nextInt();
                int[] a = new int[N];
                int[] b = new int[N];
                Point[] c = new Point[2 * N];
                for(int i = 0; i < N; i++){
                    int v = nextInt();
                    a[i] = v;
                    c[i] = new Point(v, i+1);
                }
                
                for(int i = 0; i < N; i++){
                    int v = nextInt();
                    b[i] = v;
                    c[N+i] = new Point(v, i + 1);
                }
                
                int MOD = nextInt();
                
                Arrays.sort(c);
                
                long answer = 1;
                int i = 0;
                while(i < c.length){
                    int j = i;
                    while(j < c.length && c[i].x == c[j].x) j++;
                    int two = 0;
                    for(int k = i; k + 1 < j; k++) if(c[k].y == c[k+1].y) two++;
                    long now = fact(j - i, two, MOD);
                    answer = (answer * now) % MOD;
                    i = j;
                }
                
                out.println(answer);
	}

	
	
	
	private long fact(int N, int two, int MOD){
            long result = 1;
            two = -two; //these are actually divided by 2 in the operation hence we will take them out as we do fact for the numerator
            
            for(int i = 1; i <= N; i++){
                int x = i;
                while(x % 2 == 0){
                    x = x/ 2;
                    two++;
                }
                result = (result * x) % MOD; //NOTE: x is multiplied after taking all its pow of 2 OUT
            }
            
            //in case if we have take more than needed twos out, put them back in 
            for(int i = 0; i < two; i++) result = (result * 2) % MOD;
            return result;
        }
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	//-----------------------------------------------------------
	public static void main(String[] args) {
		new Main().run();
	}

        public void debug(Object... arr){
            System.out.println(Arrays.deepToString(arr));
        }

        public void print1Int(int[] a){
                for(int i = 0; i < a.length; i++)
                        System.out.print(a[i] + " ");
                System.out.println();
        }
        
        public void print2Int(int[][] a){
                for(int i = 0; i < a.length; i++){
                        for(int j = 0; j < a[0].length; j++){
                                System.out.print(a[i][j] + " ");
                        }
                        System.out.println();
                }
        }
        
	public void run() {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
                        out = new PrintWriter(System.out);
			tok = null;
			solve();
			in.close();
                        out.close();
		} catch (IOException e) {
			System.exit(0);
		}
	}

	public String nextToken() throws IOException {
		while (tok == null || !tok.hasMoreTokens()) {
			tok = new StringTokenizer(in.readLine());
		}
		return tok.nextToken();
	}

	public int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	public long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	public double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}
        PrintWriter out;
	BufferedReader in;
	StringTokenizer tok;
}