eolymp
bolt
Try our new interface for solving problems
Problems

Nicholas Problem

Nicholas Problem

Time limit 1 second
Memory limit 128 MiB
prb513

Nicholas must deliver gifts to n (n10^18) children. He wonders in how many ways he can do it. You need to answer this simple question. Since this number may be very large, print the result modulo m (m2009).

Input data

Two positive integers n and m.

Output data

Print the number of possible ways deliver presents.

Examples

Input example #1
1 100
Output example #1
1
Input example #2
5 1000
Output example #2
120
Author PAWLO1993