//Code 1
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
long long a;
long long b;
long long c;
long long d=0;
cin>>a>>d;
if(d!=0) b=d;
else b=1;
c=pow(a,b);
if(c<=1000000000) cout<<c;
else if(c<0) cout<<"-1";
else cout<<"-1";
}
//Code 2
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
long long a,b;
double m;
cin>>a>>b;
m=pow(a,b);
long long e=m;
if(e<=1000000000) cout<<e;
else cout<<-1;
}
//Code 3(60pts)
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
double a,b,c;
cin>>a>>b;
c=pow(a,b);
if(c<=1000000000) cout<<c;
else cout<<"-1";
}
//Code 4
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
long long a,b,c;
cin>>a>>b;
c=pow(a,b);
if(c<=1000000000) cout<<c;
else cout<<-1;
}