#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
ull maxn=pow(2,31)-1;
ull n,m;
ull ksm(ull a,ull b)
{
ull ans=1;
while(b)
{
if(b&1) ans=ans*a;
b>>=1;
a=a*a;
}
return ans;
}
int main()
{
cin>>n>>m;
if(n==1)
{
cout<<1<<endl;
return 0;
}
if(ksm(n,m)>maxn) cout<<-1<<endl;
else cout<<ksm(n,m);
return 0;
}
RT 评测