#include <bits/stdc++.h>
using namespace std;
int n;
int a[100010];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", &a[i]);
  sort(a, a + n);
  int cnt = 0, cur = a[0], l = a[0], r = a[n - 1];
  for (int i = 1; i < n; ++i)
    if (a[i] > cur + 1) {
      printf("NO\n");
      return 0;
    } else if (a[i] == cur)
      a[cnt++] = a[i];
    else
      cur = a[i];
  n = cnt;
  cur = l, cnt = 1;
  for (int i = 0; i < n; ++i)
    if (a[i] == cur)
      cnt++;
    else if (a[i] > cur + 1) {
      printf("NO\n");
      return 0;
    } else {
      if (cnt) cnt--;
      if (cnt == 0) {
        cur = a[i];
        cnt = 1;
      }
    }
  if (cur != r - 1 || cnt != 1)
    printf("NO\n");
  else
    printf("YES\n");
  return 0;
}
