a,n = map(int,input().split()) print(mod) print(pow(a,n,mod))