N,M = map(int,(input().split())) ans = 1 for i in range(N):ans *= M print(ans)