#include <bits/stdc++.h>
using namespace std;
int a[100010], num[100010];
int main() {
  int n, maxx = 0, minn = 1000000000, flag = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    minn = min(a[i], minn);
  }
  for (int i = 1; i <= n; i++) {
    a[i] = a[i] - minn;
    if (a[i] > n) {
      flag = 1;
      break;
    }
    num[a[i]]++;
    maxx = max(a[i], maxx);
  }
  if (flag == 1) {
    printf("NO\n");
    return 0;
  }
  int l = num[0], x;
  for (int i = 1; i <= maxx; i++) {
    if (num[i] < l) {
      flag = 1;
      break;
    }
    if (l == 0) {
      flag = 1;
      break;
    }
    l = num[i] - l;
  }
  if (l != 0) flag = 1;
  if (flag == 1)
    printf("NO\n");
  else
    printf("YES\n");
  return 0;
}
