#include<bits/stdc++.h>
#define int long long
using namespace std;

signed main(){
    int n;cin >> n;
    vector<int> a(n);
    for(int i=0;i<n;i++){
        cin >> a.at(i);
    }
    sort(a.begin(),a.end());
    for(int i=0;i<n;i++){
        
        if(!(a.at(i)==i+1)){
            cout << "No" << endl;
            return 0;
        }
        
    }
    cout << "Yes" << endl;
}
#include "bits/stdc++.h"
  #include "ext/pb_ds/assoc_container.hpp"
  #include "ext/pb_ds/tree_policy.hpp"
using namespace std;
  using namespace __gnu_pbds;
 
  template<class T> 
  using ordered_set = tree<T, null_type,less<T>, rb_tree_tag, tree_order_statistics_node_update> ;
  
  template <typename T>
  using ordered_multiset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;

  template<class key, class value, class cmp = std::less<key>>
  using ordered_map = tree<key, value, cmp, rb_tree_tag, tree_order_statistics_node_update>;
  // find_by_order(k)  returns iterator to kth element starting from 0;
  // order_of_key(k) returns count of elements strictly smaller than k;

  #define WTF ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);cerr.tie(0);
  // #define endl "\n"
  #define int long long
  #define ll long long
  #define pi pair<int, int>
  #define vi vector<int>
  #define vc vector<char>
  #define pb push_back
 
  #define mat vector<vi>
  #define matc vector<vc>
  #define set0(x) memset(x,0,sizeof(x));
  #define makemat(n, m, init) vector<vi>(n, vi(m, init))
  #define makematc(n, m) vector<vc>(n, vc(m, '.'))
 
  #define F first
  #define S second
  #define all(x) x.begin(), x.end()
  #define FOR(i, a, b) for (int i = a; i <= b; i++)
  #define RFOR(i, a, b) for (int i = a; i >= b; i--)
  #define PI 3.141592653589793
  #define set0(x) memset(x,0,sizeof(x));
  
  #define szz size()

#ifdef LOCAL
  #include "./dbg.h"
#else
  #define vvn(...) 1
  #define dbg(...) 2
#endif

const int N = 2e5;
const int nax = 1e7+50;
const int  INF = 2e9 + 5;
const int MOD = 998244353;//1e9+7;
 
void mini(int &a, int b) { a = min(a, b); }
void maxi(int &a, int b) { a = max(a, b); }

const int dx[]={-1, 0, 1, 0}, dy[]={0, 1, 0, -1};
// const int dx[]={-1, -1, 0, 1, 1, 1, 0, -1}, dy[]={0, 1, 1, 1, 0, -1, -1, -1};


    void solve(int T){
      int n;
      cin>>n;
      set<int>s;
      FOR(i,1,n){
        int k; 
        cin>>k;
        s.insert(k);
      }
      cout<<(((int)s.szz == n && *s.begin()==1 && *prev(s.end())==n)?"Yes\n":"No\n");
    } 
 
  int32_t main(){

    // freopen("in.txt", "r", stdin);
    // freopen("out.txt", "w", stdout);
   WTF;
  //  init();
  // cout<<fixed<<setprecision(10);
      int tt=1;
      // cin>>tt;
     FOR(i,1,tt)solve(i);
     
    return 0;
  }
  