#include <bits/stdc++.h>
using namespace std;
int N, a[100005], Min, Max, cnt[100005];
int main(void) {
  scanf("%d", &N);
  for (int i = 0; i < N; ++i) scanf("%d", &a[i]);
  sort(a, a + N);
  Min = a[0];
  for (int i = 0; i < N; ++i) {
    a[i] -= Min;
    if (a[i] > 100005) {
      puts("NO");
      return 0;
    }
    ++cnt[a[i]];
    Max = max(Max, a[i]);
  }
  bool ok = true;
  int curr = cnt[0] - 1;
  for (int i = 1; i < Max; ++i) {
    if (cnt[i] < curr + 2) ok = false;
    curr = cnt[i] - (curr + 2);
  }
  if (curr + 1 != cnt[Max]) ok = false;
  if (ok)
    puts("YES");
  else
    puts("NO");
  return 0;
}
