Sum of powers#9644

Sum of powers

1 second
128 megabytes
Medium

Find the value of the sum (1^n + 2^n + 2 \cdot 3^n + 3 \cdot 4^n + 4 \cdot 5^n + \ldots + 99 \cdot 100^n) \mod m.

Input

Two positive integers and m~(n, m \le 10^8).

Output

Print the value of the sum modulo .

Examples

Example 1

Loading
Loading