#include <bits/stdc++.h>
using namespace std;
const int inf = 0x7fffffff;
int a[100001];
int t[100001];
inline int read() {
  int X = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    X = (X << 1) + (X << 3) + ch - '0';
    ch = getchar();
  }
  return X * f;
}
int main() {
  int n = read();
  cin >> a[0];
  int mi = a[0];
  for (int i = 1; i < n; i++) cin >> a[i], mi = min(a[i], mi);
  sort(a, a + n);
  int flag = 1;
  for (int i = 0; i < n; i++) {
    if (a[i] - mi >= 100001) {
      flag = 0;
      break;
    }
    t[a[i] - mi]++;
  }
  for (int i = 1; i < a[n - 1] - mi + 1; i++) {
    if (t[i] == 0) {
      flag = 0;
      break;
    }
    if (i != a[n - 1] - mi && t[i] <= t[i - 1]) {
      flag = 0;
      break;
    }
    if (i == a[n - 1] - mi && t[i] != t[i - 1]) {
      flag = 0;
      break;
    }
    t[i] -= t[i - 1];
  }
  if (flag == 0)
    cout << "NO" << endl;
  else
    cout << "YES" << endl;
  return 0;
}
