fun main(args: Array<String>) {
    readLine()!!
    val A = readLine()!!.split(" ").map{it.toLong()}.toTypedArray()

    if (A.last() != 2L) {
        println(-1)
        return
    }

    A.reverse()

    var l = 2L
    var u = 2L

    for (a in A) {
        l = (l + a - 1) / a * a
        u = (u / a) * a + (a - 1)

        if (l > u) {
            println(-1)
            return
        }
    }

    println("$l $u")
}
