#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
const long long MOD = 1e9 + 7;
const long long INF = 1LL << 60;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
long long isPrime(long long n) {
  if (n < 2) {
    return 0;
  }
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      return 0;
    }
  }
  return 1;
}
vector<long long> getDivisor(long long n) {
  vector<long long> v;
  for (long long i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      v.push_back(i);
      if (i != n / i) {
        v.push_back(n / i);
      }
    }
  }
  sort(v.begin(), v.end());
  return v;
}
void printb(unsigned long long v) {
  unsigned long long mask = (long long)1 << (sizeof(v) * CHAR_BIT - 1);
  do putchar(mask & v ? '1' : '0');
  while (mask >>= 1);
}
void putb(unsigned long long v) {
  putchar('0'), putchar('b'), printb(v), putchar('\n');
}
bool solve(long long a) {
  if (1 <= a && 9 >= a)
    return true;
  else
    false;
}
signed main() {
  long long A, B;
  cin >> A >> B;
  if (solve(A) && solve(B))
    cout << A * B << endl;
  else
    cout << -1 << endl;
  return 0;
}
