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
import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 7)


def p(M, N, mod):
    if N == 0:
        return 1
    if N % 2 == 0:
        half = p(M, N // 2, mod)
        return half * half % mod
    else:
        return M * p(M, N - 1, mod) % mod


if __name__ == "__main__":
    M, N = map(int, input().split())
    mod = 1_000_000_007
    ans = p(M, N, mod)
    print(ans)
