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