#include <bits/stdc++.h>
using namespace std;
int n, a[100100], d[100100];
int main() {
  cin >> n;
  int mn = 1000111222, mx = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    mn = min(mn, a[i]);
    mx = max(mx, a[i]);
  }
  for (int i = 0; i < n; i++) {
    a[i] -= mn;
    if (a[i] > n) {
      puts("NO");
      return 0;
    }
    d[a[i]]++;
  }
  mx -= mn;
  d[0]--;
  d[mx]--;
  for (int i = 1; i <= mx - 1; i++)
    if (d[i] < 2) {
      puts("NO");
      return 0;
    } else
      d[i] -= 2;
  for (int i = 0; i <= mx; i++)
    if (d[i]) {
      if (d[i] > d[i + 1]) {
        puts("NO");
        return 0;
      }
      d[i + 1] -= d[i];
    }
  puts("YES");
}
