import java.util.Scanner

fun main(args: Array<String>) {
    val scanner = Scanner(System.`in`)
    val k = scanner.nextInt()
    val a = Array<Int>(k, { 0 })
    for (i in (0..(k - 1))) {
        a[i] = scanner.nextInt()
    }
    if (a[k - 1] >= 3) {
        println("-1")
        return
    }
    var ansMax: Long = 2
    var ansMin: Long = 2
    for (j in (1..k)) {
        val i = k - j
        ansMax += (a[i] - 1)
        if (j == k) {
            println("$ansMin $ansMax")
            return
        }
        ansMax = ansMax / a[i - 1] * a[i - 1]
        ansMin = ((ansMin - 1) / a[i - 1] + 1) * a[i - 1]
        if (ansMin > ansMax) {
            println("-1")
            return
        }
    }
}