n, m = (int(z) for z in input().split()) print(m ** n)