#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
int main() {
  set<int> mset;
  for (int i = 1; i <= 9; i++) {
    for (int j = 1; j <= 9; j++) {
      mset.insert(i * j);
    }
  }
  int n, m;
  scanf("%d %d", &n, &m);
  if (mset.find(n * m) == mset.end())
    printf("-1\n");
  else
    printf("%d\n", n * m);
  return 0;
}
