object Main extends App {
    var inputs = readLine.split(" ").map(_.toInt)
    var can = true
    for(i <- inputs) {
        if(i > 9) {
            can = false
            println(-1)
        }
    }
    if(can) {
        println(inputs.reduce(_ * _))
    }

}