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
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
input:
5 8

output:
390625
"""

import sys


def mod_pow(x, n, _mod):
    res = 1
    while n > 0:
        if n & 1:
            res = res * x % _mod
        x = pow(x, 2) % _mod
        n >>= 1
    return res


if __name__ == '__main__':
    _input = sys.stdin.readlines()
    n1, n2 = map(int, _input[0].split())
    M = 1000000007
    # print(pow(n1, n2, M))
    print(mod_pow(n1, n2, M))