#include<iostream>
#include<algorithm>
#include<vector>
#include<cmath>
#include<string>
#include<set>
#include<bitset>
#include<cassert>
#include<numeric>
#define ll long long
#define MOD 1000000007
using namespace std;
//aのb乗
ll mypow(ll a,ll b){
    ll ans=1;
    for(ll i=0;i<b;i++){
        ans*=a;
    }
    return ans;
}

int main(){
    ll n;
    cin>>n;
    vector<ll> a(n);
    for(ll i=0;i<n;i++){
        cin>>a[i];
    }
    sort(a.begin(),a.end());
    //ll ans=1;
    /*
    for(int i=0;i<a.size();i++){
        if(a[i]==1){
            ans*=(a[i]+1);
        }else{
            ans*=a[i];
        }
        ans%=MOD;
    }
    cout<<ans<<endl;
    */
    ll ans=a[0]+1;
    for(ll i=1;i<a.size();i++){
        if(a[i]-a[i-1]==1){
            ans*=2;
        }else{
            ans*=(a[i]-a[i-1]+1);
        }
        ans%=MOD;
    }
    cout<<ans<<endl;
    return 0;

}
//157,753,845,000
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cstring>
#include <complex>
#include <stack>
#include <queue>
#include <unordered_map>
#include <map>
using namespace std;
int main()
{
	int N = 0;
	cin >> N;
	vector<int>A;
	int a = 0;
	for (int i = 0; i < N; i++)
	{
		cin >> a;
		A.push_back(a);
	}
	sort(A.begin(), A.end());
	int b = A[N - 1];
	vector<int>B;
	int c = 0;
	for (int i = 2; i <= b; i++)
	{
		for (int j = 0; j < N; j++)
		{
			if (A[j] % i == 0)
			{
				c++;
			}
		}
		B.push_back(c);
		c = 0;
	}
	int max = 0;
	int ans = 0;
	for (int i = 0; i < B.size(); i++)
	{
		if (max < B[i])
		{
			max = B[i];
			ans = i + 2;
		}
	}
	cout << ans << endl;
	return 0;
}