#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  cin >> a >> b;
  string c = to_string(a), d = to_string(b);
  for (int i = 0; i < c.size(); i++)
    if (c[i] == '0') {
      cout << -1 << endl;
      return 0;
    }
  for (int i = 0; i < d.size(); i++)
    if (d[i] == '0') {
      cout << -1 << endl;
      return 0;
    }
  cout << a * b << endl;
  return 0;
}
