#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  cin >> a >> b;
  for (int i = 1; i < 10; i++) {
    if (a == i and b == i) {
      cout << a * b << "\n";
    }
  }
  cout << -1 << "\n";
}
