#include <bits/stdc++.h>
int main(void) {
  int a, b, ans;
  scanf("%d %d");
  ans = a * b;
  if (a <= 1 && b <= 1 && a < 10 && b < 10) {
    printf("%d\n", ans);
  } else {
    printf("-1\n");
  }
  return 0;
}
