#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int i, n, c, m, f, s;
  cin >> n;
  vector<long long int> v(n);
  vector<pair<long long int, long long int> > d;
  pair<long long int, long long int> t;
  for (i = 0; i < n; i++) cin >> v[i];
  sort(v.begin(), v.end());
  c = 1;
  for (i = 1; i < n; i++) {
    if (v[i] == v[i - 1])
      c++;
    else {
      t.first = v[i - 1];
      t.second = c;
      d.push_back(t);
      c = 1;
    }
  }
  t.first = v[n - 1];
  t.second = c;
  d.push_back(t);
  m = d.size();
  if (m < 2)
    f = 0;
  else {
    c = 0;
    for (i = 1; i < m; i++) d[i].second -= d[i - 1].second;
    f = 0;
    if (!d[m - 1].second) f = 1;
    for (i = 0; i < m - 1; i++) {
      if (d[i].second <= 0) {
        f = 0;
        break;
      }
    }
    for (i = 1; i < m; i++) {
      if (d[i].first - d[i - 1].first != 1) {
        f = 0;
        break;
      }
    }
  }
  if (f)
    cout << "YES";
  else
    cout << "NO";
  cout << endl;
}
