#include <bits/stdc++.h>
using namespace std;
const int N = 1000;
const int inf = (int)1e9 + 1;
const long long big = (long long)1e18 + 1;
const int P = 239;
const int MOD = (int)1e9 + 7;
const int MOD1 = (int)1e9 + 9;
const double eps = 1e-9;
const double pi = atan2(0, -1);
const int ABC = 26;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.precision(20);
  int n;
  cin >> n;
  int a[n];
  map<int, int> mapa;
  int maxx = -inf, minx = inf;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    mapa[a[i]]++;
    maxx = max(maxx, a[i]);
    minx = min(minx, a[i]);
  }
  if (!--mapa[minx]) mapa.erase(minx);
  if (!--mapa[maxx]) mapa.erase(maxx);
  for (int x = minx + 1; x < maxx; x++) {
    if (!(mapa.find(x) != mapa.end() && mapa[x] >= 2)) {
      cout << "NO\n";
      return 0;
    }
    if (!-- --mapa[x]) mapa.erase(x);
  }
  for (auto it = mapa.begin(); it != mapa.end();) {
    auto it1 = it;
    it1++;
    if (it1 == mapa.end() || it->first + 1 != it1->first) {
      if (it->second != 0) {
        cout << "NO\n";
        return 0;
      }
    } else {
      if (it->second > it1->second) {
        cout << "NO\n";
        return 0;
      }
      it1->second -= it->second;
    }
    it = it1;
  }
  cout << "YES\n";
  return 0;
}
