#include <bits/stdc++.h>
using namespace std;
const int MAXN = int(1e5 + 7);
int a[MAXN];
int arr[MAXN];
int mx = -1;
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  memset(a, 0, sizeof a);
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  sort(arr, arr + n);
  mx = 0;
  a[mx] = 1;
  for (int i = 1; i < n; i++) {
    if (arr[i] != arr[i - 1]) {
      if (arr[i] - arr[i - 1] > 1) {
        cout << "NO\n";
        return 0;
      }
      mx++;
      a[mx] = 0;
    }
    a[mx]++;
  }
  if (mx == 0 && n != 1) {
    cout << "NO\n";
    return 0;
  }
  for (int i = 1; i <= mx; i++) a[i]--;
  int B = a[0];
  for (int i = 1; i <= mx; i++) {
    B = a[i] + 1 - B;
    if (B < 0 || (i < mx && B <= 0)) {
      cout << "NO\n";
      return 0;
    }
  }
  if (B == 0) {
    cout << "YES\n";
  } else {
    cout << "NO\n";
  }
}
