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