Limits 1s, 512 MB

You will be given two integers XX and NN, you have to calculate XNX^N modulo 1000000007.

Input

The only line will have two integers XX (0X10000000 ≤ X ≤ 1000000) and NN (0N1090 ≤ N ≤ 10^9). Both XX and NN will not be zero at the same time.

Output

Please write one line, the answer of the problem.

Sample

InputOutput
1 5
1

Submit

Login to submit.

Contributors

Statistics

58% Solution Ratio
ILoveMymensinghEarliest, Sep '19
ILoveMymensinghFastest, 0.0s
ShafinLightest, 0 B
sarthakmannaShortest, 52B
Toph uses cookies. By continuing you agree to our Cookie Policy.