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 <bits/stdc++.h>
const long long INF = INT_MAX / 2;
const long long MOD = 1000000007;
const long double PI = 3.1415926;
using namespace std;
long long int ans = 0, sum = 0, n, k, cnt = 0, w, h;
string s;
vector<long long int> v;
vector<pair<long long int, long long int> > vp;
vector<vector<long long int> > vv(50, vector<long long int>(50, INF));
vector<string> vs;
vector<char> vc;
set<long long int> st;
map<char, long long int> mp;
int main() {
  cin >> n >> k;
  ans = 1;
  for (long long int i = (long long int)(1); i < (long long int)(k + 1); i++) {
    ans *= n;
    ans %= MOD;
  }
  cout << ans << endl;
}
