Practice on Toph

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

Exponential Growth

By TarifEzaz, backbencher16 · Limits 1s, 512 MB

You will be given two integers X and N, you have to calculate XN modulo 1000000007.

Input

The only line will have two integers X (1 ≤ X ≤ 1000000) and N (0 ≤ N ≤ 109 ).

Output

Please write one line, the answer of the problem.

Sample

InputOutput
1 5
1

Both X and N will not be zero at the same time.


Discussion
Statistics

50% Solution Ratio

ILoveMymensinghEarliest, 1M ago

ILoveMymensinghFastest, 0.0s

ShafinLightest, 0 B

sarthakmannaShortest, 52B

Submit

Login to submit