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