#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const int INF = int(1e9);
const long long LINF = long long(1e18);
const int MAS = int(1e6 + 10);
const double EPS = 1e-7;
const long long MAX = 4294967296;
const long long MOD = long long(1e9 + 7);
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int a, b;
  cin >> a >> b;
  if ((a * b) % 10 == 0)
    cout << -1;
  else
    cout << a * b;
}
