#include <bits/stdc++.h>
using namespace std;
int a[1000005], b[1000005];
int main() {
  int n, t;
  cin >> n;
  for (int R = 0; R < (n); R++) scanf("%d", &a[R]);
  sort(a, a + n);
  int base = a[0];
  b[0]++;
  int cont = 0;
  for (int i = (1); i < (n); i++) {
    if (a[i] > a[i - 1] + 1) {
      puts("NO");
      exit(0);
    }
    if (a[i] == a[i - 1] + 1) cont++;
    b[a[i] - base]++;
  }
  for (int i = (1); i < (cont); i++) {
    if (b[i] - b[i - 1] <= 0) {
      puts("NO");
      exit(0);
    } else
      b[i] -= b[i - 1];
  }
  if (b[cont - 1] == b[cont])
    puts("YES");
  else
    puts("NO");
  return 0;
}
