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.Map;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.util.HashMap;
import java.util.Set;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Diego Huerfano ( diego.link )
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		OutputWriter out = new OutputWriter(outputStream);
		TaskD solver = new TaskD();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskD {
    public void solve(int testNumber, InputReader in, OutputWriter out) {
        final int n=in.readInt();
        int a[]=new int[n], b[]=new int[n];
        Map<Integer, Integer> map=new HashMap<Integer, Integer>();
        for( int i=0; i<n; i++ ) {
            a[i]=in.readInt();
            if( map.containsKey( a[i] ) )
                map.put( a[i], map.get( a[i] ) +1 );
            else
                map.put( a[i], 1 );
        }
        for( int i=0; i<n; i++ ) {
            b[i]=in.readInt();
            if( map.containsKey( b[i] ) )
                map.put( b[i], map.get( b[i] ) +1 );
            else
                map.put( b[i], 1 );
        }
        final int m=in.readInt();

        final int MAX_N=2*(int)1e5 +1;
        int cntExpTwo[]=new int[MAX_N];
        int factor[]=new int[MAX_N];
        for( int i=1; i<cntExpTwo.length; i++ ) {
            cntExpTwo[i]=cntExpTwo[i-1];
            int num=i;
            while( (num&1)==0 ) {
                num>>=1;
                cntExpTwo[i]++;
            }
            factor[i]=num;
        }

        long specialFactorial[]=new long[MAX_N] ;
        specialFactorial[0]=1;
        for( int i=1; i<specialFactorial.length; i++ ) {
            specialFactorial[i]=(specialFactorial[i-1]*factor[i])%m;
        }

        int rep=0;
        for( int i=0; i<n; i++ ) {
            if( a[i]==b[i] )
                rep++;
        }

        long ans=1;
        int numOfExpTwo=0;
        for( int key : map.keySet() ) {
            ans*=specialFactorial[map.get( key )];
            ans%=m;
            numOfExpTwo+=cntExpTwo[map.get( key )];
        }
        for( int i=1; i<=numOfExpTwo-rep; i++ ) {
            ans<<=1;
            ans%=m;
        }
        out.printLine( ans );
    }

}

class InputReader {

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int readInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public boolean isSpaceChar(int c) {
        if (filter != null)
            return filter.isSpaceChar(c);
        return isWhitespace(c);
    }

    public static boolean isWhitespace(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
    }
}

class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

    public void print(Object...objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0)
                writer.print(' ');
            writer.print(objects[i]);
        }
    }

    public void printLine(Object...objects) {
        print( objects );
        writer.println();
    }

    public void close() {
        writer.close();
    }
}

