#include <bits/stdc++.h> using namespace std; int main() { long long a,b; cin>>a>>b; if(pow(a,b)<=10e9)cout<<pow(a,b); else cout<<-1; return 0; }