using namespace std; int main(){ long long a,b,c=1; cin>>a>>b; for(int i=0;i<b;i++){ c*=a; if(c>1000000000){cout<<-1;return 0;} } cout<<c; }