s = input()
sp = s.split()

N = int(sp[0])
M = int(sp[1])

print(M**N)