#include <bits/stdc++.h>
using namespace std;
long long n;
long long niz[100005];
long long maxi = 0, mini = 1e15;
long long br;
map<long long, long long> m;
long long trn;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> niz[i];
    m[niz[i]]++;
    mini = min(mini, niz[i]);
    maxi = max(maxi, niz[i]);
  }
  m[mini]--;
  m[maxi]++;
  trn = mini;
  while (trn != maxi) {
    if (m[trn + 1] < m[trn] + 2) {
      cout << "NO\n";
      return 0;
    }
    br += 2 * m[trn] + 2;
    m[trn + 1] -= m[trn] + 2;
    m[trn] -= m[trn];
    trn++;
  }
  if (br == n) {
    cout << "YES\n";
    return 0;
  }
  if (n == 1) {
    cout << "YES\n";
    return 0;
  }
  cout << "NO\n";
  return 0;
}
