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