#include<cstdio>
typedef long long ll;
const int maxn=100000;
int n,a[maxn+10]; ll minv=2,maxv=2;
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;++i) scanf("%d",&a[i]);
	for(int i=n;i>=1;--i){
		minv=(minv-1)/a[i]+1; maxv=maxv/a[i];
		if(minv>maxv){
			printf("-1"); return 0;
		}
		minv=minv*a[i]; maxv=(maxv+1)*a[i]-1;
	}
	printf("%lld %lld",minv,maxv); return 0;
}