#include<bits/stdc++.h>
using namespace std;
signed main(){
  int n;
  int a;
  bool f=false;
  map<int,int> v;
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>a;
    v[a]++;
    if(v[a]!=1) f=true;
  }
  if(f) cout<<"No\n";
  else cout<<"Yes\n";
}
#include <bits/stdc++.h>
//#include <ext/pb_ds/tree_policy.hpp>
//#include <ext/pb_ds/assoc_container.hpp>

//#define ordered_set tree<int, null_type, less<int >,rb_tree_tag, tree_order_statistics_node_update>
//using namespace __gnu_pbds;
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#define ll long long
#define ld long double
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define vii vector<int>
#define vll vector<ll>
#define clr(v, d) memset(v,d,sizeof(v))
using namespace std;
const int N = 2e5 + 9;



int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    int n;
    cin>>n;
    set<int>st;
    for (int i = 0; i < n; ++i) {
        int a;
        cin>>a;
        st.insert(a);
    }
    vector<int>v;
    v.assign(all(st));
    if(v.size()!=n||v[0]!=1)cout<<"No\n";
    else{
        for(int i=1;i<n;i++){
            if(v[i]-v[i-1]!=1)return cout<<"No\n",0;
        }
        cout<<"Yes\n";
    }


    return 0;
}