#include <bits/stdc++.h>
using namespace std;
void fopen() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
  freopen("error.txt", "w", stderr);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  fopen();
  int n, m;
  cin >> n >> m;
  if (n / 10 == 0 && m / 10 == 0) {
    cout << n * m;
  } else {
    cout << -1;
  }
}
