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

	var N = List[Long](2L)

	def test(x: Long, y: List[Long]): List[Long] = {
		var list = y
		for(i<-1L until x){
			list = list ::: y.map(_ + i)
		}
		list
	}

	for(i<-0 until temp){
		N = N.filter(_ >= A(i)).filter(_%A(i) == 0)
		N = test(A(i), N)		
	}
	
	if(N == Nil) println(-1)
	else println(s"${N.min} ${N.max}")
}