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