For given integers m and n, compute mn (mod 1,000,000,007). Here, A (mod M) is the remainder when A is divided by M.

Constraints

* 1 ≤ m ≤ 100
* 1 ≤ n ≤ 109

Input


m n


Two integers m and n are given in a line.

Output

Print mn (mod 1,000,000,007) in a line.

Examples

Input

2 3


Output

8


Input

5 8


Output

390625
#include <iostream>
#include <algorithm>
#include <vector>
#include <math.h>
using namespace std;

int main(){
    int m,n;
    long long ans1=1,ans2=1,ans=1;
    int div=1000000007;
    while(cin >> m >> n){
    for(int i=0;i<50;i++){
        ans1 *= m;
        if(ans1>div) ans1 = ans1%div;
    }
    for(int j=0;j<n%50;j++){
        ans2 *= m;
        if(ans2>div) ans2 = ans2%div;
    }
    for(int k=0;k<n/50;k++){
        ans *= ans1;
        if(ans>div) ans = ans%div;
    }
    ans *= ans2
    cout << ans << endl;
    }
}