#include <bits/stdc++.h>
using namespace std;
int kol[100005];
signed main() {
  std::ios_base::sync_with_stdio(0), cin.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  int mn = a[0];
  for (int i = 0; i < n; ++i) {
    a[i] -= mn;
    if (i && a[i] - a[i - 1] >= 2) {
      cout << "NO";
      return 0;
    }
    kol[a[i]]++;
  }
  int p = 0;
  for (int i = 0; i < n; ++i) {
    if (!kol[i + 2]) {
      if (kol[i] != kol[i + 1]) {
        cout << "NO";
        return 0;
      }
      break;
    }
    if (kol[i] >= kol[i + 1]) {
      cout << "NO";
      return 0;
    }
    kol[i + 1] -= kol[i];
  }
  cout << "YES";
  return 0;
}
