#include<bits/stdc++.h> using namespace std; long long a,b; int main(){ cin>>a>>b; if(pow(a,b)>10e9) cout<<-1<<endl; else cout<<pow(a,b)<<endl; return 0; }