def main(): i = int(input()) n, m = list(int, i.split(" ")) print(m ** n) main()