#include <bits/stdc++.h>
using namespace std;
map<int, int> mp;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int tmp;
    cin >> tmp;
    mp[tmp]++;
  }
  for (map<int, int>::iterator it1 = mp.begin(); it1 != mp.end(); it1++) {
    map<int, int>::iterator cvc = mp.end();
    cvc--;
    if (it1 == cvc) {
      break;
    }
    map<int, int>::iterator it2 = it1;
    it2++;
    int cntx = it1->second, cnty = it2->second;
    int x = it1->first, y = it2->first;
    if (y != x + 1) {
      cout << "NO";
      return 0;
    }
    if (cntx > cnty) {
      cout << "NO";
      return 0;
    } else if (cntx == cnty) {
      map<int, int>::iterator tmp = mp.end();
      tmp--;
      if (it2 != tmp) {
        cout << "NO";
        return 0;
      }
    }
    mp[y] = cnty - cntx;
  }
  map<int, int>::iterator t = mp.end();
  t--;
  if (t->second != 0) {
    cout << "NO";
    return 0;
  }
  cout << "YES";
  return 0;
}
