The first line contains one integer , denoting the size of given permutation.The second line contains integers , denoting the given permutation.It is guaranteed that .
Output one line containing one integer, denoting the answer number modulo .
4 3 4 1 2
8
The 8 permutations are: