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