#include <bits/stdc++.h>
using namespace std;
int a = 1111111111, b = 1, k;
int N[100005], A[100005];
int main() {
  int n;
  cin >> n;
  int m = n;
  while (n--) {
    cin >> k;
    a = min(a, k);
    b = max(b, k);
    A[n] = k;
  }
  if (b - a > 100003) {
    cout << "NO" << endl;
    return 0;
  }
  for (int i = 0; i < m; i++) N[A[i] - a + 1]++;
  b = b - a + 1;
  a = 1;
  bool is = 1;
  N[a]++;
  N[b]++;
  for (int i = a; i < b; i++) {
    if (N[i] < 2) {
      is = 0;
      break;
    }
    N[i + 1] -= N[i];
    N[i + 1] += 2;
  }
  if (N[b] != 2) is = 0;
  if (is)
    cout << "YES";
  else
    cout << "NO";
  cout << endl;
  return 0;
}
