#include<bits/stdc++.h>
using namespace std;
int main(){
long long w;
int n,h,j=INT_MAX;
cin>>n>>h;
w=pow(n,h);
if(n>10&&h>10){
cout<<"-1";
}else if(w<j){
cout<<w;
} else{
cout<<"-1";
}
return 0;
}
/**************************************************************
Problem: 2405
User: houshanglin
Language: C++
Result: Accepted
Time:32 ms
Memory:2324 kb
****************************************************************/