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