#include <bits/stdc++.h>
using namespace std;
const int MAXN = 10000 * 100 + 1;
int a[MAXN];
map<int, int> cnt;
int main() {
  int x = 0;
  int n;
  cin >> n;
  vector<int> v;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  for (int i = 0; i < n; i++) {
    v.push_back(a[i]);
    cnt[v[i]]++;
  }
  for (int i = 0; i < n - 1; i++) {
    if (v[i] != v[i + 1] && v[i] != v[i + 1] - 1) {
      cout << "NO";
      return 0;
    }
  }
  for (int i = v[n - 1]; i >= v[0]; i--) {
    cnt[i]--;
  }
  cnt[v[n - 1]]++;
  cnt[v[0]]++;
  for (int i = v[n - 1]; i > v[0]; i--) {
    if (cnt[i] < 1) {
      cout << "NO" << endl;
      return 0;
    }
    cnt[i - 1] -= cnt[i] - 1;
    cnt[i] = 0;
  }
  if (cnt[v[0]] == 1)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
