#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void solve() {
  int n;
  cin >> n;
  map<int, int> d;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    d[x]++;
  }
  int last = -1, p = 0;
  for (auto [x, cnt] : d) {
    if (last == -1) {
      last = x;
      p = cnt;
    } else {
      if (p <= 0 || x != last + 1) {
        cout << "NO\n";
        return;
      }
      p = cnt - p;
      last = x;
    }
  }
  cout << (p == 0 ? "YES\n" : "NO\n");
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cout.precision(20);
  cout << fixed;
  solve();
}
