#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t, t1;
  cin >> t >> t1;
  if ((t > 9 || t < 1) && (t1 > 9 || t1 < 1))
    cout << -1 << endl;
  else
    cout << t * t1;
  return 0;
}
