from math import ceil

N = int(eval(input()))

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



if A[-1] != 2: print((-1))

else:

    PossibleMin, PossibleMax = A[-1], A[-1] + 1

    for i in reversed(list(range(N-1))):

        PossibleMin = ceil(PossibleMin/A[i]) * A[i]

        PossibleMax = (PossibleMax//A[i]) * A[i] + A[i] - 1

    if PossibleMax >= PossibleMin: print((PossibleMin, PossibleMax))

    else: print((-1))

import sys



def solve():

    input = sys.stdin.readline

    K = int(eval(input()))

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

    if A[K-1] != 2: print((-1))

    else:

        minN, maxN = 2, 3

        for i in reversed(list(range(K - 1))):

            if maxN < A[i]: 

                print((-1))

                break

            else:

                lb = (minN - 1) // A[i]

                hb = maxN // A[i]

                if lb == hb: 

                    print((-1))

                    break

                else:

                    minN = A[i] * (lb + 1)

                    maxN = A[i] * hb + A[i] - 1

        else: print((minN, maxN))

    return 0



if __name__ == "__main__":

    solve()
from math import ceil

N = int(eval(input()))
A = [int(a) for a in input().split()]
if A[-1] != 2:
    print((-1))
else:
    PossibleMin, PossibleMax = A[-1], A[-1] + 1
    for i in reversed(list(range(N - 1))):
        PossibleMin = ceil(PossibleMin / A[i]) * A[i]
        PossibleMax = (PossibleMax // A[i]) * A[i] + A[i] - 1
    if PossibleMax >= PossibleMin:
        print((PossibleMin, PossibleMax))
    else:
        print((-1))

import sys


def solve():
    input = sys.stdin.readline
    K = int(eval(input()))
    A = [int(a) for a in input().split()]
    if A[K - 1] != 2:
        print((-1))
    else:
        minN, maxN = 2, 3
        for i in reversed(list(range(K - 1))):
            if maxN < A[i]:
                print((-1))
                break
            else:
                lb = (minN - 1) // A[i]
                hb = maxN // A[i]
                if lb == hb:
                    print((-1))
                    break
                else:
                    minN = A[i] * (lb + 1)
                    maxN = A[i] * hb + A[i] - 1
        else:
            print((minN, maxN))
    return 0


if __name__ == "__main__":
    solve()

-from math import ceil +import sys -N = int(eval(input())) -A = [int(a) for a in input().split()] -if A[-1] != 2: -    print((-1)) -else: -    PossibleMin, PossibleMax = A[-1], A[-1] + 1 -    for i in reversed(list(range(N - 1))): -        PossibleMin = ceil(PossibleMin / A[i]) * A[i] -        PossibleMax = (PossibleMax // A[i]) * A[i] + A[i] - 1 -    if PossibleMax >= PossibleMin: -        print((PossibleMin, PossibleMax)) + +def solve(): +    input = sys.stdin.readline +    K = int(eval(input())) +    A = [int(a) for a in input().split()] +    if A[K - 1] != 2: +        print((-1)) -        print((-1)) +        minN, maxN = 2, 3 +        for i in reversed(list(range(K - 1))): +            if maxN < A[i]: +                print((-1)) +                break +            else: +                lb = (minN - 1) // A[i] +                hb = maxN // A[i] +                if lb == hb: +                    print((-1)) +                    break +                else: +                    minN = A[i] * (lb + 1) +                    maxN = A[i] * hb + A[i] - 1 +        else: +            print((minN, maxN)) +    return 0 + + +if __name__ == "__main__": +    solve()