Rhezo and Big Powers
Approved
Easy
Math
Number theory
Ready
59.0% success
16,545 attempts
1s time
256MB memory
1024KB max code

Rhezo likes numbers of the form \(A^B\). But computing \(A^B\), for any 2 numbers A and B is a hard task for him. He would like you to help him out in this.

Input:
First line of input contains a single integer A. Second line contains the integer B.

Output:
Help Rhezo find \(A^B\). As this number can be large, print it modulo \(10^9+7\).

Constraints:

  • \( 1 \le A \le 10^9 \)
  • \( 1 \le B \le 10^{10^5} \)
Examples
Input
4
3
Output
64

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...