object Main extends App {

  val arr = scala.io.StdIn.readLine().split(" ").map(_.toInt)


  def solve() =  {
    if(arr.forall(x => 1 <= x && x <= 9)) arr.product
    else -1
  }

  println(solve)

}