#include <bits/stdc++.h>
using namespace std;
template <class T>
ostream& operator<<(ostream& out, const vector<T>& data) {
  out << "[";
  for (int i = 0; i < data.size(); ++i)
    out << data[i] << (i == data.size() - 1 ? "" : ",");
  out << "]";
  return out;
}
template <class T>
ostream& operator<<(ostream& out, const set<T>& s) {
  out << "{";
  for (typename set<T>::iterator itr = s.begin(); itr != s.end(); ++itr)
    out << *itr << " ";
  out << "}";
  return out;
}
template <class T>
ostream& operator<<(ostream& out, const multiset<T>& s) {
  out << "{";
  for (typename multiset<T>::iterator itr = s.begin(); itr != s.end(); ++itr)
    out << *itr << " ";
  out << "}";
  return out;
}
template <class T1, class T2>
ostream& operator<<(ostream& out, const pair<T1, T2>& p) {
  out << "(" << p.first << "," << p.second << ")";
  return out;
}
template <class T1, class T2>
ostream& operator<<(ostream& out, const map<T1, T2>& m) {
  for (typename map<T1, T2>::const_iterator itr = m.begin(); itr != m.end();
       ++itr)
    out << itr->first << "->" << itr->second << " ";
  return out;
}
int N;
multiset<int> a;
map<int, vector<int> > l;
int minv, maxv;
void noans() {
  cout << "NO" << endl;
  exit(0);
}
void init() {
  scanf("%d", &N);
  for (int i = 0; i < N; ++i) {
    int d;
    scanf("%d", &d);
    a.insert(d);
  }
  minv = *a.begin();
  maxv = *a.rbegin();
  if (maxv == minv) noans();
  for (int i = minv; i <= maxv; ++i) {
    multiset<int>::iterator itr = a.find(i);
    if (itr == a.end()) noans();
    a.erase(itr);
  }
  for (int i = maxv - 1; i >= minv + 1; --i) {
    multiset<int>::iterator itr = a.find(i);
    if (itr == a.end()) noans();
    a.erase(itr);
  }
  while (!a.empty()) {
    int small = *a.begin();
    int nexts = small + 1;
    if (a.find(nexts) == a.end()) noans();
    multiset<int>::iterator itr1 = a.find(small);
    multiset<int>::iterator itr2 = a.find(nexts);
    a.erase(itr1);
    a.erase(itr2);
  }
  cout << "YES" << endl;
  return;
  for (int i = minv; i <= maxv; ++i) {
    printf("%d ", i);
    vector<int>& v = l[i];
    for (int j = 0; j < v.size(); ++j) printf("%d ", v[j]);
  }
  for (int i = maxv - 1; i >= minv + 1; --i) printf("%d ", i);
  printf("\n");
}
void york() {}
int main() {
  init();
  york();
  return 0;
}
