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