def main(): a=int(input()) b=int(input()) if a==1 and b==1: print(0) exit() print(pow(a,b)) main()