#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[100001];
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  int cnt = 0, last = a[0], j;
  for (int i = 0; i < n;) {
    j = i + 1;
    while (a[j] == a[i]) j++;
    if (a[i] - last > 1) {
      cout << "NO";
      return 0;
    }
    int s = j - i;
    if (s > cnt) {
      cnt = s - cnt;
      last = a[i];
    } else
      cnt -= s;
    i = j;
  }
  if (cnt == 0)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
