import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

int readint() { return readln.chomp.to!int; }
int[] readints() { return readln.split.to!(int[]); }

long lowest(long p, long low) {
    return ((low + p - 1) / p) * p;
}

long calcMin(int[] xs) {
    long n = xs[$ - 1];
    for (int i = cast(int)xs.length - 1; i >= 0; i--) {
        n = lowest(xs[i], n);
    }

    long m = n;
    for (int i = 0; i < xs.length; i++) {
        m -= m % xs[i];
    }

    return m == 2 ? n : -1;
}

long calcMax(int[] xs, long min) {
    long lo = min;
    long hi = long.max / 2 - 1;
    long ans = min;

    while (lo <= hi) {
        long m = (lo + hi) / 2;

        bool ok = true;
        long x = m;
        for (int i = 0; i < xs.length; i++) {
            x -= x % xs[i];
        }
        if (x != 2) ok = false;

        if (ok) {
            ans = max(ans, m);
            lo = m + 1;
        }
        else {
            hi = m - 1;
        }
    }

    return hi;
}

void main() {
    readint;
    auto xs = readints();

    auto min = calcMin(xs);
    if (min == -1) {
        writeln(-1);
    }
    else {
        auto max = calcMax(xs, min);
        writeln(min, " ", max);
    }
}