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