import sys

input = sys.stdin.readline



N = list(map(int,input().split()))

A = [int(x) for x in input().split()]



low,high = 2,2



for a in A[::-1]:

    low += (-low)%a

    high -= high%a

    high += (a-1)



if low > high:

    print((-1))

else:

    print((low,high))
import sys



read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines



N, *A = list(map(int, read().split()))



def f(A):

    low, high = 2, 2

    for x in A[::-1]:

        low += (-low) % x

        high -= (high) % x

        if low > high:

            print((-1))

            return

        low, high = low, high+(x-1)

    print((low, high))



f(A)
import sys

input = sys.stdin.readline
N = list(map(int, input().split()))
A = [int(x) for x in input().split()]
low, high = 2, 2
for a in A[::-1]:
    low += (-low) % a
    high -= high % a
    high += a - 1
if low > high:
    print((-1))
else:
    print((low, high))

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N, *A = list(map(int, read().split()))


def f(A):
    low, high = 2, 2
    for x in A[::-1]:
        low += (-low) % x
        high -= (high) % x
        if low > high:
            print((-1))
            return
        low, high = low, high + (x - 1)
    print((low, high))


f(A)

-input = sys.stdin.readline -N = list(map(int, input().split())) -A = [int(x) for x in input().split()] -low, high = 2, 2 -for a in A[::-1]: -    low += (-low) % a -    high -= high % a -    high += a - 1 -if low > high: -    print((-1)) -else: +read = sys.stdin.buffer.read +readline = sys.stdin.buffer.readline +readlines = sys.stdin.buffer.readlines +N, *A = list(map(int, read().split())) + + +def f(A): +    low, high = 2, 2 +    for x in A[::-1]: +        low += (-low) % x +        high -= (high) % x +        if low > high: +            print((-1)) +            return +        low, high = low, high + (x - 1) + + +f(A)