a,n=map(int,input().split()) for i in range(n): if a**i>10**7: print(0) break else: print(a**n)