#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000")
template <class T>
bool scanff(T &ret) {
  char c;
  int sgn;
  T bit = 0.1;
  if (c = getchar(), c == EOF) return 0;
  while (c != '-' && c != '.' && (c < '0' || c > '9')) c = getchar();
  sgn = (c == '-') ? -1 : 1;
  ret = (c == '-') ? 0 : (c - '0');
  while (c = getchar(), c >= '0' && c <= '9') ret = ret * 10 + (c - '0');
  if (c == ' ' || c == '\n') {
    ret *= sgn;
    return 1;
  }
  while (c = getchar(), c >= '0' && c <= '9') ret += (c - '0') * bit, bit /= 10;
  ret *= sgn;
  return 1;
}
using namespace std;
int cot[100100];
int a[100100];
int main() {
  int n;
  scanff(n);
  for (int i = int(1); i <= int(n); i++) scanff(a[i]);
  sort(a + 1, a + 1 + n);
  for (int i = int(2); i <= int(n); i++) {
    if (a[i] - a[i - 1] > 1) {
      printf("NO\n");
      return 0;
    }
  }
  int temp = a[1] - 1;
  for (int i = int(1); i <= int(n); i++) {
    a[i] -= temp;
    cot[a[i]]++;
  }
  int num = a[n];
  for (int i = int(2); i <= int(num); i++) {
    cot[i] -= cot[i - 1];
    if (cot[i] <= 0 && i != num) {
      printf("NO\n");
      return 0;
    }
  }
  if (cot[num] == 0)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
