rt
#include <bits/stdc++.h> using namespace std; int a,b; int main(){ scanf("%d %d",&a,&b); printf("%.0lf",pow(a,b)>1e9?-1.0:pow(a,b)); return 0; }