#include<iostream> #include<cmath> using namespace std; int main(){ int a,b; cin>>a,b; long long c; c=pow(a,b); long long d; d=pow(10,9); if(c<=d){ cout<<c; } else{ cout<<-1; } return 0; }