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