#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
using vi = vector<int>; // intの1次元の型に vi という別名をつける
using vvi = vector<vi>; // intの2次元の型に vvi という別名をつける
using vvvi = vector<vvi>;
using vb = vector<bool>;
using ll = long long; //約9.0*10^18
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll =vector<vvll>;
using std::reverse;
const double PI=3.14159265358979323846;
const ll inf=9223372036854775807;

#define rep0(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()

ll fac(ll n) {ll ans=1;rep0(i,n){ans=ans*(n-i);};return ans;}//n!
ll conb(ll n,ll m){return fac(n)/fac(m)/fac(n-m);}//nCm

//小数点以下を指定したい時　　→→→→  cout << fixed << setprecision();
//int→string　　string str = to_string(num);
//string→int   int num = atoi(numStr.c_str());
//複数のvector管理→;vector<tuple<string, int, int>> SP(N);
//int max = *max_element(all(A));最大値
//int min = *min_element(all(B));最小値
//floor(x)=[x]
// *max_element(a.begin(),a.begin()+5);aの最初から6番目までの最大値/計算量に不安あり
// *min_element(,);
// sort は昇順１２３４５
//ll n;cin>>n;vll a(n);rep0(i,n){cin>>a[i];}

int main() {
   ll n;cin>>n;vll a(n);rep0(i,n){cin>>a[i];}
   sort(all(a));
   string flag ="Yes";
   rep0(i,n){
       if(a[i]!=i+1){
           flag="No";
       }
   }
   cout<<flag<<endl;
   return 0;
}
#include<iostream>
#include<vector>
using namespace std;
int main() {
	int n;
	cin >> n;
	bool b = true;
	vector<int>vec(n);
	fill(vec.begin(), vec.end(), 0);
	for (int i = 0; i < n; i++) {
		int m;
		cin >> m;
		if (vec[m-1]==0) {
			vec[m-1] = 1;
		}
		else {
			b = false;
			break;
		}
	}
	if (b)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
}