#include <bits/stdc++.h>
using namespace std;
long long power(long long x, long long y, long long md = 1000000007) {
  long long res = 1;
  x %= md;
  while (y > 0) {
    if (y & 1) res = (res * x) % md;
    x = (x * x) % md;
    y = y >> 1;
  }
  return res % md;
}
long long max1(long long a, long long b, long long c = -1000000000000000000LL,
               long long d = -1000000000000000000LL) {
  long long mx1 = (a > b) ? a : b, mx2 = (c > d) ? c : d;
  return ((mx1 > mx2) ? mx1 : mx2);
}
struct node {
  vector<long long> v, w;
};
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long a, b;
  cin >> a >> b;
  if (a > b) swap(a, b);
  if (a >= 10 && b >= 10) {
    cout << "-1";
    return 0;
  }
  if (a < 10 && b < 10) {
    cout << a * b;
    return 0;
  }
  long long u1 = a % 10;
  long long u2 = b % 10;
  if (u1 * u2 >= 10) {
    cout << "-1";
    return 0;
  }
  cout << a * b;
}
