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