#include<bits/stdc++.h> using namespace std; int c(int x, int n){ int v=1; while(n--){ v*=x; } return v; } int main(){ long long a,b; cin>>a>>b; long long s=0; if(a+b>19){ cout<<-1; return 0; } printf("%d",c(a,b)); return 0; }