#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 10;
int a[MAX];
vector<int> ans;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  int t = 1;
  for (int i = 1; i < n; i++) {
    if (a[i] != a[i - 1]) {
      if (a[i] - a[i - 1] > 1) {
        cout << "NO" << endl;
        return 0;
      }
      ans.push_back(t - 1);
      t = 1;
    } else
      t++;
  }
  ans[0]++;
  ans.push_back(t);
  for (int i = ans.size() - 2; i >= 0; i--) {
    if (ans[i] < ans[i + 1] || ans[i] == 0) {
      cout << "NO" << endl;
      return 0;
    } else {
      ans[i] -= ans[i + 1];
      ans[i]++;
    }
  }
  if (ans[0] != 1) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
}
