#include <bits/stdc++.h>
using namespace std;
long long A, B;
string a, b;
int main() {
  ios::sync_with_stdio(false);
  cin >> A >> B;
  a = to_string(A);
  b = to_string(B);
  for (int i = 0; i <= a.length(); i++)
    if (a[i] == '0') {
      cout << "-1";
      return 0;
    }
  for (int i = 0; i <= b.length(); i++)
    if (b[i] == '0') {
      cout << "-1";
      return 0;
    }
  cout << A * B;
  return 0;
}
