#include <bits/stdc++.h>
int a[100000], k[100000];
int main() {
  int n, i, min = INT_MAX, max = 0;
  scanf("%d", &n);
  for (i = 1; i <= n; ++i) {
    scanf("%d", a + i);
    if (a[i] < min) min = a[i];
    if (a[i] > max) max = a[i];
  }
  if ((max - min) * 2 > n) {
    printf("NO\n");
    return 0;
  }
  for (i = 1; i <= n; ++i) ++k[a[i] - min];
  for (i = 0; i < max - min; ++i)
    if (k[i] < 1 || k[i] > k[i + 1]) {
      printf("NO\n");
      return 0;
    } else
      k[i + 1] -= k[i];
  if (!k[max - min])
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
