#include <bits/stdc++.h>
using namespace std;
long long MOD = 1e9 + 7;
void init() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
void solve() {
  long long n;
  cin >> n;
  map<long long, long long> hm;
  set<long long> us;
  long long mx = 0;
  for (long long i = 1; i <= n; ++i) {
    long long x;
    cin >> x;
    hm[x]++;
    us.insert(x);
    mx = max(mx, x);
  }
  bool f = true;
  for (auto x : us) {
    long long a = x - 1;
    long long b = x + 1;
    if (us.find(a) == us.end() && us.find(b) == us.end()) {
      f = false;
      break;
    }
  }
  if (us.size() == 1) {
    f = false;
  }
  if (!f) {
    cout << "NO" << endl;
  } else {
    auto it = us.begin();
    long long p = *it;
    it++;
    long long q = *it;
    if (hm[p] > hm[q]) {
      f = false;
    } else {
      long long spaces = hm[q] - hm[p];
      long long curr_num = q + 1;
      while (curr_num <= mx) {
        ;
        ;
        ;
        if (curr_num == mx) {
          if (hm[curr_num] != spaces) {
            f = false;
            break;
          }
        } else {
          if (us.find(curr_num) == us.end()) {
            f = false;
            break;
          } else {
            if (spaces == 0) {
              f = false;
              break;
            }
            if (hm[curr_num] < spaces) {
              f = false;
              break;
            } else {
              long long z = hm[curr_num] - spaces;
              spaces = z;
            }
          }
        }
        curr_num++;
      }
    }
    if (!f) {
      cout << "NO" << endl;
    } else {
      cout << "YES" << endl;
    }
  }
}
int main() {
  init();
  long long t = 1;
  while (t--) {
    solve();
  }
}
