#include <bits/stdc++.h>
using namespace std;
class A9x9 {
 public:
  void solve(std::istream& in, std::ostream& out) {
    int a, b;
    in >> a >> b;
    if (a % 10 == 0 || b % 10 == 0) {
      out << "-1";
    } else {
      out << a * b;
    }
  }
};
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  A9x9 solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}
