#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long a, b;
  cin >> a >> b;
  long long x, y;
  x = a;
  y = b;
  while (x) {
    if (x % 10 == 0) {
      cout << -1;
      return 0;
    }
    x = x / 10;
  }
  while (y) {
    if (y % 10 == 0) {
      cout << -1;
      return 0;
    }
    y = y / 10;
  }
  cout << a * b;
}
