[<EntryPoint>]
let main fsharp_saikooooo =
    let ab = stdin.ReadLine().Split(' ') |> Array.map int
    let a = ab.[0]
    let b = ab.[1]
    let ans = if a.ToString().Length > 1 || b.ToString().Length > 1 then -1 else a * b
    ans |> stdout.WriteLine
    0