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