let arr=readLine()!.characters.split{$0==" "}.map{Int(String($0))!}

let a : Int = arr[0]
let b : Int = arr[1]

func is1to9( number: Int ) -> Bool {
  if( number >= 1 && number <= 9 ) {
    return true
  } else {
    return false
  }
}

if( is1to9(a) && is1to9(b) ) {
  print( a * b )
} else {
  print( "-1" )
}