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>
using namespace std;
long long int mod, tavan, paye;
long long int bsq(long long int x, long long int n, long long int mod) {
  if (n == 0) return 1;
  if (n == 1) return x;
  long long int saven = bsq(x, n / 2, mod);
  if (n % 2 == 1) return (x * (saven * saven) % mod) % mod;
  return (saven * saven) % mod;
}
long long int mod_inv(long long int n, long long int primeMod) {
  return bsq(n, primeMod - 2, primeMod);
}
int main() {
  mod = 1e9 + 7;
  cin >> paye >> tavan;
  cout << bsq(paye, tavan, mod) << endl;
  return 0;
}
