#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i = (int)(a); i <= (int)(b); i++)
#define NFOR(i,a,b) for(int i = (int)(a); i >= (int)(b); --i)
#define endl "\n"
#define mp make_pair
#define X first
#define Y second
#define inf 1e9
#define mod 1000000007
#define pb push_back
#define Case cout<<"Case #"<<++cas<<": ";
#define fastio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define all(v) v.begin(),v.end()
#define sz(x) int(x.size())
// #define lli int
typedef long long int lli;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<pii> vii;
typedef pair<lli,lli> pll;
typedef vector<lli> vl;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef complex <long double> complex_t;
const long double PI = acos((long double)-1.0);

#define pr(...) dbs(#__VA_ARGS__, __VA_ARGS__)
template <class T> void dbs(string str, T t) {cerr << str << " : " << t << "\n";}
template <class T, class... S> void dbs(string str, T t, S... s) {int idx = str.find(','); cerr << str.substr(0, idx) << " : " << t << ","; dbs(str.substr(idx + 1), s...);}
template <class S, class T>ostream& operator <<(ostream& os, const pair<S, T>& p) {return os << "(" << p.first << ", " << p.second << ")";}
template <class T>ostream& operator <<(ostream& os, const vector<T>& p) {os << "[ "; for (auto& it : p) os << it << " "; return os << "]";}
template <class T>ostream& operator <<(ostream& os, const set<T>& p) {os << "[ "; for (auto& it : p) os << it << " "; return os << "]";}
template <class S, class T>ostream& operator <<(ostream& os, const map<S, T>& p) {os << "[ "; for (auto& it : p) os << it << " "; return os << "]";}
template <class T> void prc(T a, T b) {cerr << "["; for (T i = a; i != b; ++i) {if (i != a) cerr << ", "; cerr << *i;} cerr << "]\n";}

vector<ll> arr;
bool poss1 = false;
bool poss2 = false;

ll val(ll temp) {
    FOR(i, 0, sz(arr)-1) {
        temp = (temp/arr[i])*arr[i];
    }
    return temp;
} 

ll binSearchForMin(ll b, ll e) {
    ll mid = (b+e)/2;
    while (b < e) {
        mid = (b+e)/2;
        if (b +1 == e) {
            if (val(e) == 2) {
                poss1 = true;
                return e;
            } else {
                if (val(b) == 2) poss1 = true;
                return b;
            }
        }
        if(val(mid) <= 2) {
            b = mid;
        } else {
            e = mid;
        }
    }
    return b;
}

ll binSearchForMax(ll b, ll e) {
    ll mid = (b+e)/2;
    while ( b < e) {
        mid = (b+e)/2;
        // pr(b, e);
        if (b+1 == e) {
            if (val(e) == 2) {
                poss2 = true;
                return e;
            } else {
                if (val(b)==2) poss2 = true;
                return b;
            }
        }
        if(val(mid)>=2) {
            e = mid;
        } else {
            b = mid;
        }
    } 
    return b;
}

int main() {
    int k;
    cin >> k;
    FOR(i, 0, k-1) {
        ll temp; cin >> temp; arr.pb(temp);
    }
    ll maxAnswer = binSearchForMax(1, 1e18);
    ll minAnswer = binSearchForMin(1, 1e18);
    swap(minAnswer, maxAnswer);
    if (minAnswer > maxAnswer || (!poss1 || !poss2)) {
        cout << "-1" << endl;
    } else {
        cout << minAnswer << " " << maxAnswer << endl;
    }
return 0;}

Measured memory_bytes: 1400