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