#include <bits/stdc++.h>
using namespace std;
const long long int N = 500009;
const long long int mod = 1000000007;
string a, b;
void pre() {}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  pre();
  cin >> a >> b;
  for (auto i : a) {
    if (i == '0') {
      cout << -1;
      return 0;
    }
  }
  for (auto i : b) {
    if (i == '0') {
      cout << -1;
      return 0;
    }
  }
  long long int x = stoi(a);
  long long int y = stoi(b);
  cout << (x * y) << "\n";
}
