#include<bits/stdc++.h> using namespace std; long long a,b,d,e=1,f=0,g,h,j,k; char c; int main(){ cin>>a>>b; d=a; for(int i=1;i<=b;i++){ d=d*d; } if (d<=10000000000){ cout<<d; } else{ cout<<"-1"; } return 0; }