N,M=map(int,raw_input().rstrip().split()) print M**N