#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e3 + 5;
const int maxc = 61;
const int maxlog = 20;
const int mod = 1e9 + 7;
const int sq = 350;
const long double pi = 3.14159265358979323846264;
vector<int> nums;
map<int, int> cnt;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout.precision(20);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    cnt[x]++;
    if (cnt[x] == 1) nums.push_back(x);
  }
  sort(nums.begin(), nums.end());
  if (nums.size() == 1) {
    if (n == 1)
      cout << "YES";
    else
      cout << "NO";
    return 0;
  }
  for (int i = 0; i < nums.size() - 1; i++) {
    if (nums[i] + 1 != nums[i + 1]) {
      cout << "NO";
      return 0;
    }
  }
  for (int i = 0; i < nums.size() - 2; i++) {
    if (cnt[nums[i + 1]] <= cnt[nums[i]]) {
      cout << "NO";
      return 0;
    }
    cnt[nums[i + 1]] -= cnt[nums[i]];
  }
  if (cnt[nums.back()] == cnt[nums.back() - 1])
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
