#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 100;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  sort(v.begin(), v.end());
  int gap = 0;
  for (int i = 0; i < n; i++) {
    if (i > 0 && v[i] != v[i - 1] + 1) {
      cout << "NO" << endl;
      return 0;
    }
    int l = i, r = i;
    for (int j = i; j < n; j++) {
      if (v[j] == v[i]) {
        r = j;
      } else {
        break;
      }
    }
    int cnt = r - l + 1;
    if (cnt < gap) {
      cout << "NO" << endl;
      return 0;
    }
    gap = cnt - gap;
    i = r;
    if (i != n - 1 && gap == 0) {
      cout << "NO" << endl;
      return 0;
    }
  }
  if (gap != 0) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
  }
  return 0;
}
