Problem: Rhezo likes numbers of the form A^B. But computing A^B, for any 2 numbers A and B is a hard task for him. He would like you to help him out in this.

Input:
First line of input contains a single integer A. Second line contains the integer B.

Output:
Help Rhezo find A^B. As this number can be large, print it modulo 10^9+7.

Constraints:
 1 ≤ A ≤ 10^9  
 1 ≤ B ≤ 10^{10^5} 

SAMPLE INPUT
4
3

SAMPLE OUTPUT
64

Solution (in PYTHON):

Solution:
MOD = long(1000000007)
'''
def fastpow(a,b):
	if b == 0:
		return 1
	if b == 1:
		return a%MOD
	d = fastpow(a, b/2)
	if b%2 == 0:
		return (d*d)%MOD
	else:
		return (((a*d)%MOD)*d)%MOD
'''
a = long(raw_input())
b = long(raw_input())

print pow(a,b,MOD)