#include <bits/stdc++.h>
using namespace std;
const int INF = 1000 * 1000 * 1000;
const long long INF64 = 1000LL * 1000LL * 1000LL * 1000LL * 1000LL * 1000LL;
int n;
int a[100500];
int b[100500];
int d[100500];
void Load() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
}
vector<int> v[2];
void Solve() {
  sort(a, a + n);
  if (a[n - 1] - a[0] > n + 2) {
    cout << "NO";
    return;
  }
  int m = a[n - 1] - a[0] + 1;
  for (int i = 0; i < m; i++) d[i] = a[0] + i;
  int j = 0;
  for (int i = 0; i < m; i++) {
    while (j < n && a[j] < d[i]) j++;
    if (j == n || a[j] > d[i]) {
      cout << "NO";
      return;
    }
    a[j] = -1;
    j++;
  }
  int k = 0;
  for (int i = 0; i < n; i++)
    if (a[i] != -1) b[k++] = a[i];
  if (k == 0) {
    cout << "NO";
    return;
  }
  int x = 0;
  for (int i = k - 1; i >= 0; i--) {
    if (i == k - 1 || b[i] == b[i + 1])
      v[x].push_back(b[i]);
    else {
      x ^= 1;
      v[x].push_back(b[i]);
    }
  }
  reverse(v[0].begin(), v[0].end());
  reverse(v[1].begin(), v[1].end());
  if (d[m - 1] == b[k - 1])
    x = 1;
  else
    x = 0;
  for (int i = m; i < m + k; i++) {
    if (v[x].empty()) {
      cout << "NO";
      return;
    }
    d[i] = v[x].back();
    v[x].pop_back();
    x ^= 1;
  }
  if (abs(d[0] - d[n - 1]) != 1) {
    cout << "NO";
    return;
  }
  for (int i = 0; i < n - 1; i++)
    if (abs(d[i] - d[i + 1]) != 1) {
      cout << "NO";
      return;
    }
  cout << "YES";
}
int main() {
  Load();
  Solve();
  return 0;
}
