object Main extends App {
	val temp = scala.io.StdIn.readInt
	val A = scala.io.StdIn.readLine.split(" ").map(_.toLong).reverse

	var x = 2L
	var y = 2L

	for(i<-0 until temp){
		val t = x/A(i)

		if(x%A(i) == 0){
			x = t * A(i)
		}else{
			x = (t + 1) * A(i)
		}

		y = y/A(i)*A(i) + A(i) - 1
	}

	if(x > y) println(-1)
	else println(s"$x $y")
}