#include <bits/stdc++.h>
using namespace std;
int A[100000 + 5l];
int F[100000 + 5l];
int main() {
  int N;
  cin >> N;
  for (int i = 1; i <= N; ++i) {
    scanf("%d", &A[i]);
  }
  sort(A + 1, A + N + 1);
  int p = 0;
  for (int i = 1; i <= N; ++i) {
    if (A[i] == A[i - 1]) {
      F[p]++;
    } else {
      if (A[i] > A[i - 1] + 1 and i > 1) {
        cout << "NO";
        return 0;
      }
      F[++p] = 1;
    }
  }
  if (p < 2) {
    cout << "NO";
    return 0;
  }
  int ans = 1;
  int L = 1;
  F[1]--;
  while (ans < N) {
    if (F[L + 1]) {
      L++;
      F[L]--;
      ++ans;
      continue;
    }
    if (F[L - 1]) {
      L--;
      F[L]--;
      ++ans;
      continue;
    }
    cout << "NO";
    return 0;
  }
  if (L == 2)
    cout << "YES";
  else
    cout << "NO";
}
