N, M = [int(i) for i in input().split()] print(M**N)