Wilsons Theorem
medium
you have been given number n and p, you need to find n! % p (n factorial mod p). p is a prime no.
Constraints
1<= n <= 10^9 1<= p <= 10^9 1<= abs(n - p) <= 1000
Format
Input
The first line contains the integer n and p.
Output
Output an integer in a line containing n! modulo P.
Example
Sample Input
5 11
Sample Output
10