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

void main() {
    int k;
    long[] a;

    scan(k);
    a = readln.split.to!(long[]);

    auto u = new long[](k), b = new long[](k);

    if (a[k-1] == 2) {
        u[k-1] = 3;
        b[k-1] = 2;
    }
    else {
        writeln(-1);
        return;
    }

    foreach_reverse (i ; 0 .. k - 1) {
        u[i] = (u[i+1]/a[i])*a[i] + a[i] - 1;
        b[i] = ((b[i+1] + a[i] - 1) / a[i]) * a[i];

        if (b[i] > u[i]) {
            writeln(-1);
            return;
        }
    }

    debug {
        writeln(u);
        writeln(b);
    }

    writeln(b[0], " ", u[0]);
}


void scan(T...)(ref T args) {
    string[] line = readln.split;
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}


void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}