Binomial Coefficient 5

Compute the remainder of the binomial coefficient C(N, K) divided by M, where M is not necessarily prime.

Medium7Number theoryCombinatoricsNo attempts yetTime limit1sMemory limit256 MB

Problem

You are given a natural number NN and an integer KK. Write a program that computes the remainder of the binomial coefficient (NK)\binom{N}{K} divided by MM. MM is not guaranteed to be prime.

Input

The first line contains NN, KK, and MM, separated by spaces. (1N4×1061 \le N \le 4 \times 10^6, 0KN0 \le K \le N, 2M4×1062 \le M \le 4 \times 10^6)

Output

Print the remainder of (NK)\binom{N}{K} divided by MM on the first line.