eolymp
bolt
Try our new interface for solving problems
Problems

Exponentiation by modulo

Exponentiation by modulo

Given integers a, b and p. Calculate the value ab mod p.

Input

Two integers a and b (0a, b101000), each in a separate line.

Output

Print ab mod p, where modulo p = 1000000007.

Time limit 1 second
Memory limit 128 MiB
Input example #1
5
3
Output example #1
125