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