#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  cin >> a >> b;
  if (a * b % 10 == 0 and a * b / 10 >= 2) {
    cout << "-1" << endl;
  } else {
    cout << a * b << endl;
  }
}
