#include <bits/stdc++.h>
using namespace std;
const int mn = 100005;
int n, a[mn];
int main() {
  n = ({
    int t;
    scanf("%d", &t);
    t;
  });
  for (int i = 0; i < n; i++)
    a[i] = ({
      int t;
      scanf("%d", &t);
      t;
    });
  sort(a, a + n);
  bool ans = 1;
  int p1 = 0, p2 = 0;
  while (p1 < n) {
    p2 = p1 + 1;
    while (p2 < n && a[p2] == a[p1]) p2++;
    if (n - p2 < p2 - p1) {
      ans = 0;
      goto finish;
    }
    if (a[p2] != a[p1] + 1) {
      ans = 0;
      goto finish;
    }
    if (2 * p2 - p1 < n && a[2 * p2 - p1] != a[p2]) {
      ans = 0;
      goto finish;
    }
    if (2 * p2 - p1 == n && a[2 * p2 - p1 - 1] != a[p2]) {
      ans = 0;
      goto finish;
    }
    p1 = 2 * p2 - p1;
  }
finish:;
  if (ans)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
