Little Dima has two sequences of points with integer coordinates: sequence (*a*<sub class="lower-index">1</sub>, 1), (*a*<sub class="lower-index">2</sub>, 2), ..., (*a*<sub class="lower-index">*n*</sub>, *n*) and sequence (*b*<sub class="lower-index">1</sub>, 1), (*b*<sub class="lower-index">2</sub>, 2), ..., (*b*<sub class="lower-index">*n*</sub>, *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 (*p*<sub class="lower-index">1</sub>, *q*<sub class="lower-index">1</sub>), (*p*<sub class="lower-index">2</sub>, *q*<sub class="lower-index">2</sub>), ..., (*p*<sub class="lower-index">2·*n*</sub>, *q*<sub class="lower-index">2·*n*</sub>) and (*x*<sub class="lower-index">1</sub>, *y*<sub class="lower-index">1</sub>), (*x*<sub class="lower-index">2</sub>, *y*<sub class="lower-index">2</sub>), ..., (*x*<sub class="lower-index">2·*n*</sub>, *y*<sub class="lower-index">2·*n*</sub>) distinct, if there is such *i* (1 ≤ *i* ≤ 2·*n*), that (*p*<sub class="lower-index">*i*</sub>, *q*<sub class="lower-index">*i*</sub>) ≠ (*x*<sub class="lower-index">*i*</sub>, *y*<sub class="lower-index">*i*</sub>).

As the answer can be rather large, print the remainder from dividing the answer by number *m*.
The first line contains integer *n* (1 ≤ *n* ≤ 10<sup class="upper-index">5</sup>). The second line contains *n* integers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub> (1 ≤ *a*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">9</sup>). The third line contains *n* integers *b*<sub class="lower-index">1</sub>, *b*<sub class="lower-index">2</sub>, ..., *b*<sub class="lower-index">*n*</sub> (1 ≤ *b*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">9</sup>). The numbers in the lines are separated by spaces.

The last line contains integer *m* (2 ≤ *m* ≤ 10<sup class="upper-index">9</sup> + 7).
n=int(input())
y=list(map(int,input().split()))
z=list(map(int,input().split()))
a=sorted([[y[i],i] for i in range(n)]+[[z[i],i] for i in range(n)])
f=0
for i in range(1,2*n):
    if a[i]==a[i-1]:
        f+=1
m=int(input())
d=0
e=1
for i in range(1,2*n):
    if a[i][0]!=a[i-1][0]:
        for j in range(1,i-d+1):
            e*=j
            while f>0 and e%2==0:
                e//=2
                f-=1
            e%=m
        d=i
for j in range(1,i-d+1):
    e*=j
    while f>0 and e%2==0:
        e//=2
        f-=1
    e%=m
print(e%m)