#include <bits/stdc++.h>
const int MAXN = 1e5 + 17;
const int INF = 1e9 + 17;
const int SQRT = 320;
const int MOD = 1e9 + 7;
using namespace std;
int n;
vector<int> a;
int minn = INF, maxx;
int cnt[MAXN];
map<int, int> m;
int temp = 0;
void mainp() {
  cin >> n;
  a.resize(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a.begin(), a.end());
  for (int i = 0; i < n; i++) {
    if (!m.count(a[i])) m[a[i]] = ++temp;
    cnt[m[a[i]]]++;
    minn = min(minn, a[i]);
    maxx = max(maxx, a[i]);
  }
  int k = minn;
  while (k <= maxx) {
    if (!m.count(k) || cnt[m[k]] == 0) {
      cout << "NO" << endl;
      return;
    }
    cnt[m[k]]--;
    k++;
  }
  k = maxx - 1;
  while (k > minn) {
    if (!m.count(k) || cnt[m[k]] == 0) {
      cout << "NO" << endl;
      return;
    }
    cnt[m[k]]--;
    k--;
  }
  for (auto x : m) {
    if (cnt[m[x.first]] == 0) continue;
    if (!m.count(x.first + 1)) {
      cout << "NO" << endl;
      return;
    }
    int cc = 0;
    while (cnt[m[x.first]] && cnt[m[x.first + 1]]) {
      cnt[m[x.first]]--;
      cnt[m[x.first + 1]]--;
    }
    if (cnt[m[x.first + 1]] == 0 && cnt[m[x.first]] > 0) {
      cout << "NO" << endl;
      return;
    }
  }
  for (int i = 1; i <= temp; i++) {
    if (cnt[i]) {
      cout << "NO" << endl;
      return;
    }
  }
  cout << "YES" << endl;
}
int main() {
  mainp();
  return 0;
}
