#include <bits/stdc++.h>
using namespace std;
const long long INF = 2e9;
const long long maxn = 3e5 + 13;
long long a[maxn];
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  map<long long, long long> cnt;
  for (long long i = 1; i <= n; ++i) cin >> a[i], cnt[a[i]]++;
  vector<pair<long long, long long>> b;
  for (auto t : cnt) {
    b.push_back(t);
  }
  if (b.size() == 1) {
    cout << "NO\n";
    return 0;
  }
  for (long long i = 1; i < b.size(); ++i) {
    if (b[i].first - 1 != b[i - 1].first) {
      cout << "NO\n";
      return 0;
    }
  }
  for (long long i = 1; i < b.size() - 1; ++i) {
    if (b[i].second <= b[i - 1].second) {
      cout << "NO\n";
      return 0;
    }
    b[i].second -= b[i - 1].second;
  }
  if (b[b.size() - 1].second != b[b.size() - 2].second) {
    cout << "NO\n";
    return 0;
  }
  cout << "YES\n";
  return 0;
}
