N, M = map(int, input().split()) print(M**N)