#include <bits/stdc++.h>
using namespace std;
signed main() {
  int64_t n;
  cin >> n;
  vector<int64_t> vs(n);
  for (int64_t i = 0; i < n; i++) cin >> vs[i];
  sort(vs.begin(), vs.end());
  for (int64_t i = 1; i < n; i++) {
    if (vs[i] - vs[i - 1] > 1) {
      cout << "NO\n";
      return 0;
    }
  }
  vector<int64_t> outs(n + 1);
  for (int64_t i = 0; i < n; i++) {
    outs[vs[i] - vs[0]]++;
  }
  int64_t left = 0;
  for (int64_t i = 0; i < n; i++) {
    if (outs[i] == 0) break;
    left = 2 * outs[i] - left;
    if (left <= 0 && outs[i + 1] != 0) {
      cout << "NO\n";
      return 0;
    }
  }
  if (left == 0)
    cout << "YES\n";
  else
    cout << "NO\n";
}
