#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int INF = 1001001001;
const long long LINF = 1001002003004005006;
const double PI = acos(-1);
int d4r[] = {1, 0, -1, 0};
int d4c[] = {0, 1, 0, -1};
int d8r[] = {1, 1, 0, -1, -1, -1, 0, 1};
int d8c[] = {0, 1, 1, 1, 0, -1, -1, -1};

long long GCD(long long x, long long y) {
    if (y == 0) return x;
    return GCD(y, x % y);
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n; cin >> n;
    vector<long long> x(n);
    for(int i = 0;i < n;++i) {
        cin >> x[i];
    }
    vector<long long> prime = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47};
    long long ans = LINF;
    for(long long i = 0;i < (1 << prime.size());++i) {
        long long now = 1;
        for(int j = 0;j < prime.size();++j) {
            if(i >> j & 1) {
                now *= prime[j];
            }
        }
        bool flag = true;
        for(int i = 0; i < n;++i) {
            if(GCD(now,x[i]) == 1) {
                flag = false;
            }
        }
        if(flag == false) {
            continue;
        }
        ans = min(ans, now);
    }
    cout << ans << '\n';
    return 0;
}
#include<bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long int
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define vec vector<ll>
#define be begin()
#define en end()
#define MOD 1000000007
#define ull unsigned long long
#define pll pair<ll,ll>
#define mll map<ll,ll>
#define sll set<ll>
#define MAXN 500005
#define ll_max 5000000000000000000
using namespace std;
int main() {fastio ll t=1;//cin>>t;
    while(t--)
    {
        ll n=0,m=0,k=0,i=0,j=0,p=0,q=0,x=0,y=0,z=0,maxm=INT_MIN,minm=INT_MAX,ans=0,cnt=0,l=0,r=0,mid=0,lo=0,hi=0;string s;bool flag=false;
        cin>>n;ll a[n]; for(i=0;i<n;i++)cin>>a[i];
        sort(a,a+n);
        for(i=0;i<n;i++){
          if(a[i]==i+1){
            cnt++;
          }
        }
        if(cnt==n)cout<<"Yes"<<endl;
        else
          cout<<"No"<<endl;
        //
    }
  return 0;
}

