#include <bits/stdc++.h>
using namespace std;
int i, j, k, n, m, x, y, T, ans, big, cas, num, w, t, u, v;
bool flag;
int p[100005], a[100005];
int main() {
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  sort(a, a + n);
  int cur = 0;
  p[cur] = 1;
  for (i = 1; i < n; i++) {
    if (a[i - 1] < a[i] - 1) {
      printf("NO\n");
      return 0;
    }
    if (a[i - 1] + 1 == a[i]) {
      cur++;
      p[cur]++;
    } else {
      p[cur]++;
    }
  }
  if (cur == 0) {
    if (p[cur] == 1) {
      printf("YES\n");
      return 0;
    } else {
      printf("NO\n");
      return 0;
    }
  }
  p[0]--;
  p[cur]--;
  for (i = 1; i < cur; i++) {
    p[i] -= p[i - 1] + 2;
    p[i - 1] = 0;
    if (p[i] < 0) {
      printf("NO\n");
      return 0;
    }
  }
  p[cur] -= p[cur - 1];
  p[cur - 1] = 0;
  if (p[cur]) {
    printf("NO\n");
    return 0;
  }
  printf("YES\n");
  return 0;
}
