let scan_int () = Scanf.scanf " %d" (fun x -> x)
let print_int n = Printf.printf "%d\n" n

let () =
  let a = scan_int() and b = scan_int() in
  if a < 10 && b < 10 then print_int (a*b)
  else print_int (-1)