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
(*%) :: Integral a => a -> a -> a
x *% y = x * y `mod` lM where
    lM = 1000000007

pow :: Integral a => a -> a -> a
pow _ 0 = 1
pow 0 _ = 0
pow m 2 = m * m
pow m n
    | even n = pow (pow m 2) (n `div` 2)
    | odd n = m * pow m (n - 1)

powmod :: Integral a => a -> a -> a
powmod _ 0 = 1
powmod 0 _ = 0
powmod m 2 = m *% m
powmod m n
    | even n = powmod (powmod m 2) (n `div` 2)
    | odd n = m *% powmod m (n - 1)

main :: IO ()
main = do
    [m,n] <- map read . words <$> getLine
    putStrLn . show $ powmod m n