#include <bits/stdc++.h>
using namespace std;
int main() {
  int A, B, C;
  cin >> A >> B;
  C = A * B;
  if (C / 1 > 9) {
    cout << -1;
  } else if (C / 9 > 9) {
    cout << -1;
  } else if (C / 8 > 9) {
    cout << -1;
  } else if (C / 7 > 9) {
    cout << -1;
  } else if (C / 6 > 9) {
    cout << -1;
  } else if (C / 5 > 9) {
    cout << -1;
  } else if (C / 4 > 9) {
    cout << -1;
  } else if (C / 3 > 9) {
    cout << -1;
  } else if (C / 2 > 9) {
    cout << -1;
  } else if (C / 1 > 9) {
    cout << -1;
  } else {
    cout << C;
  }
}
