#include <bits/stdc++.h>
using namespace std;
template <typename T>
using vc = vector<T>;
using pii = pair<long long, long long>;
void xmax(long long& a, long long b) { a = max(a, b); }
void xmin(long long& a, long long b) { a = min(a, b); }
void print(vc<long long>& a, string second) {
  cerr << second << " : ";
  for (long long i = 0; i < a.size(); i++) {
    cerr << a[i] << " ";
  }
  cerr << endl;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n;
  cin >> n;
  vc<long long> a(n);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  a.push_back(1e9 + 7);
  long long last = a[0] - 1;
  long long anz = 0;
  vc<pii> wef;
  for (long long i = 0; i <= n; i++) {
    if (a[i] != last) {
      wef.push_back({last, anz});
      last = a[i];
      anz = 1;
    } else {
      anz++;
    }
  }
  last = wef[0].first;
  anz = wef[0].second;
  long long geht = 1;
  for (long long i = 1; i < wef.size(); i++) {
    if (wef[i].first - last != 1) geht = 0;
    long long anz_cur = wef[i].second;
    if (anz > anz_cur) {
      geht = 0;
      break;
    }
    if (anz == 0 && i != 1) geht = 0;
    anz = anz_cur - anz;
    last = wef[i].first;
  }
  if (anz != 0 || geht != 1) {
    cout << "NO\n";
  } else
    cout << "YES\n";
}
