N,M = list(map(int, input().split())) ans = pow(M,N) print(ans)