#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pll pair<ll, ll>
#define pii pair<
#define fi first
#define se second
#define pb push_back

const int N = 2002;
const ll mod = 1e12+7;
ll m, n, t, k, a[N], ans, b[N], d[N], tong, idx, mn, c[N];

vector< pll > adj[N], adt[N];
vector<ll> kq, v;
string s;
void check(ll x)
{
    if(kq.empty())return;
    vector<ll> pre, res;
    for(int i = 0; i < kq.size(); i ++)
    {
        if(a[kq[i]] >= x)pre.pb(kq[i]);
    }
    swap(kq, pre);
    if(kq.empty())return;
    priority_queue< ll, vector<ll>, greater<ll> > pq;
    pq.push(a[kq[0]]);
    for(int i = 1; i < kq.size(); i ++)
    {
        if(kq[i] == kq[i-1] + 1)pq.push(a[kq[i]]);
        else
        {
            while(pq.size() >= k)
            {
                res.pb(pq.top());
                pq.pop();
            }
            while(!pq.empty())pq.pop();
            pq.push(a[kq[i]]);
        }
    }
    while(pq.size() >= k)
    {
        res.pb(pq.top());
        pq.pop();
    }
    if(res.size() < m)return;
    sort(res.begin(), res.end());
    ans = min(ans, res[m-1] - res[0]);
}
void sol()
{
    cin >> n;
    for(int i = 1; i <= n; i ++)
    {
        cin >> a[i];
        if(a[i] < 1 || a[i] > n)
        {
            cout << "No";
            return;
        }
        ++b[a[i]];
    }
    for(int i = 1; i <= n; i ++)
    {
        if(b[i] != 1)
        {
            cout << "No";
            return;
        }
    }
    cout << "Yes";
}
int main()
{
    cin.tie(0);
    cout.tie(0);
    ios_base::sync_with_stdio(0);
    sol();
}
/*
nC1 * (m-1)^(i-1) +
*/


#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main() {
  ll N;
  cin >> N;

  vector<ll> A(N);
  for (int i=0; i<N; i++) {
    cin >> A[i];
  }

  sort(A.begin(), A.end());
  for (int i=1; i<N; i++) {
    if ((A[0] == 1) && (A[i-1] + 1 == A[i])) {
      // Do nothing
    } else {
      cout << "No" << endl;
      return 0;
    }
  }

  cout << "Yes" << endl;
}