Calculate the Power
Algorithms
Approved
Easy
Open
91.0% success
42,799 attempts
1s time
256MB memory
1024KB max code

Given two number A and B. Calculate the value of AB. Output may be too large so print the answer modulo 10^9+7.

Input:
Input contains two integers A and B separated by space.

Output:
Print value of AB modulo 10^9+7.

Constraints:
Test File 1 to 5:
1<=A<=10
1<=B<=10

Test File 6 to 10:
1<=A<=106
1<=B<=1010

Examples
Input
2 5

Output
32

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading Editor...