#include <iostream>
typedef long long LL;
using namespace std;
LL pow(int a, int b)
{
if(a == 1) return 1;
LL s = 1;
for(int i = 1; i <= b; i ++)
{
s = s * a;
if(s > 1000000000) return -1;
}
return s;
}
int main()
{
int a, b; cin >> a >> b;
cout << pow(a, b) << endl;
return 0;
}