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 java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.Buffer;


class Main {
	
	static long mod=1000000007;

	public static void main(String[] args) throws NumberFormatException, IOException {
		
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String s="";
		while((s=br.readLine())!=null){
			String[] a=s.split(" ");
			Long x=Long.parseLong(a[0]);
			Long y=Long.parseLong(a[1]);
			System.out.println(pow(x, y));
			
		}
	}

	public static long pow(long b,long p) {
		if(p==0){
			return 1;
		}else if(p%2==0){
			long result=pow(b, p/2);
			return ((result%mod)*(result%mod))%mod ;
		}else{
			long result=pow(b, p-1);
			return ((b%mod)*(result%mod))%mod ;
		}
		
	}

}