#include<bits/stdc++.h> using namespace std; int a,b,p; int main(){ //freopen("pow.in","r",stdin); //freopen("pow.out","w",stdout); scanf("%d%d",&a,&b); p=pow(a,b); if(p+1==-2147483647) printf("-1");//-2147483648 else if(p>1e9) printf("-1"); else printf("%d",p); }