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.

// @author Sanzhar
import java.io.*;
import java.util.*;
import java.awt.Point;

public class Template {

    BufferedReader in;
    PrintWriter out;
    StringTokenizer st;

    String next() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(in.readLine());
            } catch (Exception e) {
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    public void run() throws Exception {
        //in = new BufferedReader(new FileReader("input.txt"));
        //out = new PrintWriter(new FileWriter("output.txt"));
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        solve();
        out.flush();
        out.close();
        in.close();
    }

    public void solve() throws Exception {
        int n = nextInt();
        int[] d = new int[n];
        int same = 0;
        PriorityQueue<Point> a = new PriorityQueue<Point>(11,
                new Comparator<Point>() {

                    @Override
                    public int compare(Point p1, Point p2) {
                        return p1.x - p2.x;
                    }
                });
        for (int i = 0; i < n; i++) {
            d[i] = nextInt();
            a.add(new Point(d[i], i));
        }
        PriorityQueue<Point> b = new PriorityQueue<Point>(11,
                new Comparator<Point>() {

                    @Override
                    public int compare(Point p1, Point p2) {
                        return p1.x - p2.x;
                    }
                });
        for (int i = 0; i < n; i++) {
            int x = nextInt();
            if (d[i] == x) {
                same++;
            }
            b.add(new Point(x, i));
        }
        long m = nextLong();
        int[] c = new int[2 * n];
        int k = 0;
        int last = -1;
        while (!a.isEmpty() || !b.isEmpty()) {
            int x = 0;
            if (!a.isEmpty() && (b.isEmpty() || a.peek().x <= b.peek().x)) {
                x = a.poll().x;
            } else {
                x = b.poll().x;
            }
            //System.err.println(x);
            if (x == last) {
                c[k - 1]++;
            } else {
                c[k++]++;
                last = x;
            }
        }
        long ans = 1;
        for (int i = 0; i < k; i++) {
            for (int j = c[i]; j >= 2; j--) {
                ans *= j;
                while (same > 0 && ans % 2 == 0) {
                    ans /= 2;
                    same--;
                }
                ans %= m;
            }
        }
        out.println(ans);
    }

    public static void main(String[] args) throws Exception {
        new Template().run();
    }
}
