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>
int main(void) {
  long long m, n;
  scanf("%lld%lld", &m, &n);
  long long r = 1000000007;
  int b[32];
  long long na = n;
  int i = 0;
  while (na != 0) {
    b[i] = na % 2;
    na /= 2;
    i++;
  }
  long long a[32];
  a[0] = m;
  for (int j = 1; j <= i; j++) {
    a[j] = a[j - 1] * a[j - 1];
    a[j] = a[j] % r;
  }
  long long ans = 1;
  for (int j = 0; j <= i; j++) {
    if (b[j] != 0) {
      ans *= a[j];
      ans = ans % r;
    }
  }
  printf("%lld\n", ans);
  return 0;
}
