import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long x = sc.nextLong();
long n = sc.nextLong();
long res = exp(x,n);
System.out.println(res);
}
private static long exp(long x, long n) {
if(n==0){
return 1;
}
int count = 2;
long temp = x;
while(count <= n){
temp = temp * temp;
count *= 2;
}
long res = exp(x, n - count / 2);
res = temp * res;
return res;
}
}