fun main(args: Array<String>) {
    sandbox4()
}

fun sandbox4() {
    val (a, b) = readLine()!!.split(' ').map { it.toInt() }

    val list = (1..9).map { i -> (1..9).map { i * it } }.flatten()

    val answer = if (a * b in list) a * b else -1

    println(answer)
}
