N, M = map(int, input().split()) print(pow(M, N)) # 問題文 # There are N cards on the table. # Each cards are numbered from 1 to N. # Mr.yuki should write an integer, which is no less than 1 and on more than M, on each cards. # How many ways to write? # 制約 # N, M are intgers between 1 and 61. # 出力 # Output the answer in single line. # ということで、pow(M, N)が答え