#include <bits/stdc++.h>
using namespace std;
int a[100005], n;
int ct[100005];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  sort(a, a + n);
  bool ok = 1;
  for (int i = 0; i < n - 1; i++)
    if (a[i + 1] - a[i] > 1) ok = 0;
  if (!ok) {
    puts("NO");
    return 0;
  }
  memset(ct, 0, sizeof(ct));
  int M = 0, cnt = 0;
  for (int i = 0; i < n; i++) {
    cnt++;
    if (i == n - 1 || a[i + 1] != a[i]) {
      ct[M++] = cnt;
      cnt = 0;
    }
  }
  ct[0]--;
  ct[M - 1]--;
  for (int i = 1; i < M - 1; i++) {
    if (ct[i] < 2) ok = 0;
    ct[i] -= 2;
  }
  if (!ok) {
    puts("NO");
    return 0;
  }
  for (int i = 0; i < M - 1; i++) {
    if (ct[i] > 0) {
      if (ct[i + 1] < ct[i]) ok = 0;
      ct[i + 1] -= ct[i];
    }
  }
  if (ct[M - 1]) ok = 0;
  if (ok)
    puts("YES");
  else
    puts("NO");
  return 0;
}
