#include <bits/stdc++.h>
using namespace std;
int n, A[100010];
vector<pair<int, int> > vec;
int main() {
  int i, cnt = 0;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%d", &A[i]);
  sort(A + 1, A + n + 1);
  for (i = 1; i <= n; i++) {
    cnt++;
    if (A[i] != A[i + 1]) vec.push_back(pair<int, int>(A[i], cnt)), cnt = 0;
  }
  for (i = 0; i + 1 < vec.size(); i++) {
    if (vec[i].first + 1 != vec[i + 1].first) goto FAILED;
    if (!vec[i].second) goto FAILED;
    if (vec[i].second > vec[i + 1].second) goto FAILED;
    vec[i + 1].second -= vec[i].second;
    vec[i].second = 0;
  }
  if (vec[i].second) goto FAILED;
  printf("YES");
  return 0;
FAILED:
  printf("NO");
  return 0;
}
