#include <bits/stdc++.h>
using namespace std;
int a[110000];
map<int, int> m;
int main() {
  int n;
  cin >> n;
  int mx = -1000000002;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    m[-a[i]]++;
    mx = max(mx, -a[i]);
  }
  bool z = true;
  int prev = -1000000002;
  int tail = 0;
  for (map<int, int>::iterator it = m.begin(); it != m.end(); it++) {
    if (prev == -1000000002)
      tail = it->second * 2;
    else {
      tail = it->second * 2 - tail;
      if (tail <= 0 && it->first != mx) z = false;
    }
    if (prev != -1000000002 && it->first != prev + 1) z = false;
    prev = it->first;
  }
  if (!z || tail != 0)
    cout << "NO";
  else
    cout << "YES";
  return 0;
}
