#include <bits/stdc++.h>
using namespace std;
const long long N = 200005;
const long long MOD = 998244353;
void solve() {
  long long n, m, a, b;
  cin >> n >> m;
  a = n, b = m;
  while (a > 0) {
    long long p = a % 10;
    a /= 10;
    if (p == 0) {
      cout << "-1";
      return;
    }
  }
  a = b;
  while (a > 0) {
    long long p = a % 10;
    a /= 10;
    if (p == 0) {
      cout << "-1";
      return;
    }
  }
  cout << (n * m);
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  t = 1;
  while (t--) solve();
  return 0;
}
