#include <bits/stdc++.h>
using namespace std;
const int maxn = 100001;
int n, Min = INT_MAX;
int a[maxn], t[maxn];
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() {
  n = read();
  for (int i = 0; i < n; i++) a[i] = read(), Min = min(a[i], Min);
  sort(a, a + n);
  for (int i = 0; i < n; i++) {
    if (a[i] - Min >= maxn) {
      printf("NO");
      return 0;
    }
    t[a[i] - Min]++;
  }
  for (int i = 1; i < a[n - 1] - Min + 1; i++) {
    if (t[i] == 0) {
      printf("NO");
      return 0;
    }
    if (i != a[n - 1] - Min && t[i] <= t[i - 1]) {
      printf("NO");
      return 0;
    }
    if (i == a[n - 1] - Min && t[i] != t[i - 1]) {
      printf("NO");
      return 0;
    }
    t[i] -= t[i - 1];
  }
  printf("YES");
  return 0;
}
