eolymp
bolt
Try our new interface for solving problems
Problems

Lemurian parties

Lemurian parties

Lemur King Julian has exactly 2 * k lemurs under his control, 2 lemurs of each of k species. Julian loves to party, so he throws a party every night, but the VIP area unfortunately only has enough seats for him and n other lemurs.

Since Julian doesn't like having "the same" parties, he has to choose every day who to invite to the VIP area so that the sets of lemurs from the VIP area never repeat. Two lemurs of the same species are considered indistinguishable. Sets are considered equal if they match as multisets of lemur species.

Help Julian determine how many days he can hold various parties. Since the answer can be large, print it modulo m.

Input

One line contains two integers k, n and m (1k500 000, 0n2 * k, 2m109) - the number of lemur species, the number of seats in the VIP area and the modulo to compute the answer.

Output

Print one number - the answer to the problem modulo m.

Time limit 2 seconds
Memory limit 128 MiB
Input example #1
3 3 42
Output example #1
7
Input example #2
4 3 42
Output example #2
16
Source 2020 Cycle of Internet Olympiads for schoolchildren, Fifth team contest, Novemver 28, Problem С