#include <bits/stdc++.h>
using namespace std;
map<long long, long long> cnt;
int main() {
  long long n;
  scanf("%lld", &n);
  long long mx = 0, mn = 1e13;
  for (long long i = (1); i < (n + 1); i++) {
    long long a;
    scanf("%lld", &a);
    cnt[a]++;
    mx = max(mx, a);
    mn = min(mn, a);
  }
  if ((mx - mn + 1) != cnt.size()) {
    cout << "NO" << endl;
  } else {
    for (long long i = (mn + 1); i < (mx + 1); i++) {
      cnt[i] -= cnt[i - 1];
      if (cnt[i] < 0 || (i < mx && !cnt[i])) {
        cout << "NO\n";
        return 0;
      }
    }
    if (cnt[mx]) {
      cout << "NO\n";
    } else {
      cout << "YES\n";
    }
  }
}
