fun main(args: Array<String>) {
    val k = readLine()!!.toInt()
    val aList = readLine()!!.split(" ").map(String::toLong)
    val (min, max) = solve(k, aList)
    if (min < 0) {
        println(-1)
    } else {
        println("$min $max")
    }
}

fun solve(k: Int, aList: List<Long>): Pair<Long, Long> {
    val impossible = Pair(-1L, -1L)
    if (aList[k - 1] != 2L) {
        return impossible
    }
    var min = 2L
    var max = 3L
    for (i in k - 2 downTo 0) {
        val x = aList[i]
        min = (min + x - 1) / x * x
        max = max / x * x + x - 1
        if (min > max) {
            return impossible
        }
        // println("$min $max")
    }
    return Pair(min, max)
}