n, m = map(int, input().split()) print(m ** n)