eolymp
bolt
Try our new interface for solving problems
Problems

Sum of powers

Sum of powers

Time limit 1 second
Memory limit 128 MiB

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

Input data

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

Output data

Print the value of the sum modulo m.

Examples

Input example #1
12345678 35242346
Output example #1
5447885
Author Michael Medvedev