#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b;
  cin >> a >> b;
  string s1 = to_string(a);
  string s2 = to_string(b);
  long long pro = a * b;
  int ck = 1;
  for (long long i = 0; i < s1.length(); i++) {
    if (s1[i] == '0') ck = 0;
  }
  for (long long i = 0; i < s2.length(); i++) {
    if (s2[i] == '0') ck = 0;
  }
  if (ck == 0)
    cout << -1;
  else
    cout << pro;
}
