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.*;
import java.math.*;
 
public class Main
{
    static class Coord{
        int x, y;
        public Coord(int x, int y){
            this.x = x;
            this.y = y;
        }
 
        @Override
        public boolean equals(Object o){
            Coord ob = (Coord)o;
            return this.x == ob.x && this.y == ob.y;
        }
 
        @Override
        public int hashCode(){
            return Objects.hash(this.x, this.y);
        }
    }

    public static void process(int test_number)throws IOException
    {
        int n = ni(), a[] = new int[n], b[] = new int[n], pow2 = 0;
        HashSet<Coord> set = new HashSet<Coord>();
        HashMap<Integer, Integer> xFreq = new HashMap<>();

        for(int i = 0; i < n; i++){
            a[i] = ni();
            xFreq.putIfAbsent(a[i], 0);
            xFreq.put(a[i], xFreq.get(a[i]) + 1);

            Coord c = new Coord(a[i], i);
            set.add(c);
        }

        for(int i = 0; i < n; i++){
            b[i] = ni();
            xFreq.putIfAbsent(b[i], 0);
            xFreq.put(b[i], xFreq.get(b[i]) + 1);

            Coord c = new Coord(b[i], i);
            if(set.contains(c))
                ++pow2;
        }

        long m = nl();

        long res = 1l;

        for (Map.Entry<Integer, Integer> entry : xFreq.entrySet()){
            int freq = entry.getValue();

            long fact = 1l;
            for(long i = 1l; i <= freq; i++){
                fact *= i;
                if(pow2 != 0 && (fact & 1) == 0){
                    fact /= 2l;
                    --pow2;
                }

                fact %= m;
            }

            res = (res * fact) % m;
        }

        pn(res);
    }
    

    static final long mod = (long)1e9+7l;
    static boolean DEBUG = true;
    static FastReader sc;
    static PrintWriter out;
    public static void main(String[]args)throws IOException
    {
        out = new PrintWriter(System.out);
        sc = new FastReader();
 
        long s = System.currentTimeMillis();
        int t = 1;
        // t = ni();
        for(int i = 1; i <= t; i++)
            process(i);
 
        out.flush();
        System.err.println(System.currentTimeMillis()-s+"ms");
    }

    static void trace(Object... o){ if(!DEBUG) return; System.err.println(Arrays.deepToString(o)); };    
    static void pn(Object o){ out.println(o); }
    static void p(Object o){ out.print(o); }
    static int ni()throws IOException{ return Integer.parseInt(sc.next()); }
    static long nl()throws IOException{ return Long.parseLong(sc.next()); }
    static double nd()throws IOException{ return Double.parseDouble(sc.next()); }
    static String nln()throws IOException{ return sc.nextLine(); }
    static long gcd(long a, long b){ return (b==0)?a:gcd(b,a%b);}
    static int gcd(int a, int b){ return (b==0)?a:gcd(b,a%b); }
    
    static class FastReader{ 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastReader(){ 
            br = new BufferedReader(new InputStreamReader(System.in)); 
        } 
  
        String next(){ 
            while (st == null || !st.hasMoreElements()){ 
                try{ st = new StringTokenizer(br.readLine()); } catch (IOException  e){ e.printStackTrace(); } 
            } 
            return st.nextToken(); 
        } 
  
        String nextLine(){ 
            String str = ""; 
            try{ str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } 
            return str; 
        } 
    } 
}
