#include<bits/stdc++.h> using namespace std; int main(){ //freopen("pow.in","r",stdin); //freopen("pow.out","w",stdout); long long a,b,n; cin>>a>>b; for(int i=1;i<=b;i++){ n*=a; } if(n>1000000000){ cout<<-1; }else{ cout<<n; } return 0; }