import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop;


void main() {
    auto N = readln.chomp.to!int;
    auto A = readln.split.map!(to!long).array;

    if (A[$-1] != 2) {
        writeln(-1);
        return;
    }

    auto B = new long[][](N);
    B[$-1] = [2, 3];

    for (int i = N-2; i >= 0; --i) {
        foreach (b; B[i+1]) {
            if (b % A[i] != 0) continue;
            foreach (j; 0..A[i]) {
                B[i] ~= b + j;
            }
        }
    }

    if (B[0].length == 0) {
        writeln(-1);
    } else {
        writeln(B[0].reduce!min, " ", B[0].reduce!max);
    }
}
