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