import math import numpy as np if __name__ == '__main__': n, m = map(int, input().split()) print(m ** n)