#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100100;
int c[MAXN], a[MAXN];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> c[i];
  sort(c, c + n);
  int p = c[0], o = c[n - 1];
  if (o - p > 100000) {
    cout << "NO" << endl;
    return 0;
  }
  for (int i = 0; i < n; i++) a[c[i] - p]++;
  o -= p;
  for (int i = 1; i <= o; i++)
    if (a[i] > 0)
      a[i]--;
    else {
      cout << "NO" << endl;
      return 0;
    }
  for (int i = o; i > 1; i--)
    if (a[i - 1] <= a[i]) {
      cout << "NO" << endl;
      return 0;
    } else {
      a[i - 1] -= a[i];
      a[i - 1]--;
    }
  if (a[1] + 1 == a[0]) {
    cout << "YES" << endl;
    return 0;
  }
  cout << "NO" << endl;
  return 0;
}
