#include <bits/stdc++.h>
using namespace std;
const long long int M = 1e9 + 7;
void solve() {
  int n;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  if (n == 1) {
    cout << "YES\n";
    return;
  }
  set<int> st;
  map<int, int> mp;
  for (int i = 0; i < n; i++) {
    st.insert(arr[i]);
    mp[arr[i]]++;
  }
  vector<int> v;
  for (auto x : st) v.push_back(x);
  for (int i = 1; i < v.size(); i++)
    if (v[i] - v[i - 1] != 1) {
      cout << "NO\n";
      return;
    }
  v.clear();
  for (auto x : mp) v.push_back(2 * x.second);
  if (v.size() == 1) {
    cout << "NO\n";
    return;
  }
  for (int i = 0; i < v.size() - 1; i++) {
    if (v[i] == 0 or v[i] > v[i + 1]) {
      cout << "NO\n";
      return;
    }
    v[i + 1] = v[i + 1] - v[i];
  }
  if (v.back() != 0) {
    cout << "NO\n";
    return;
  }
  cout << "YES\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) solve();
}
