#include <bits/stdc++.h>
using namespace std;
int a[100009], N;
int tot, Count[100009];
bool NO;
bool Init() {
  cin >> N;
  for (int i = 1; i <= N; i++) cin >> a[i];
  sort(a + 1, a + N + 1);
  tot = 0;
  int lasnum = -1;
  for (int i = 1; i <= N; i++) {
    int j = i;
    while (a[j] == a[i] && j <= N) j++;
    if (a[i] != lasnum + 1 && lasnum != -1) {
      cout << "NO\n";
      return false;
    }
    lasnum = a[i];
    tot++;
    Count[tot] = j - i;
    i = j - 1;
  }
  return true;
}
void Dfs(int wh) {
  if (NO) return;
  Count[wh]--;
  if (wh < tot) {
    while (Count[wh + 1] > 0) {
      if (Count[wh] == 0) {
        NO = true;
        return;
      }
      Count[wh]--;
      Dfs(wh + 1);
    }
  }
  return;
}
void Solve() {
  Count[1]++;
  NO = false;
  Dfs(1);
  if (NO) {
    cout << "NO\n";
    return;
  } else {
    for (int i = 1; i <= tot; i++)
      if (Count[i] > 0) {
        cout << "NO\n";
        return;
      }
    cout << "YES\n";
  }
}
int main() {
  if (Init()) Solve();
}
