#include <bits/stdc++.h>
using namespace std;
map<int, int> a;
int main() {
  int n;
  scanf("%d", &n);
  while (n--) {
    int x;
    scanf("%d", &x);
    a[x]++;
  }
  for (map<int, int>::iterator it = a.begin(); it != a.end(); it++) {
    int low = it->first, cnt = it->second;
    if (!a.count(low + 1)) {
      break;
    }
    if (cnt == 0 || cnt > a[low + 1]) {
      puts("NO");
      return 0;
    }
    a[low] = 0;
    a[low + 1] -= cnt;
  }
  for (map<int, int>::iterator it = a.begin(); it != a.end(); it++) {
    if ((it->second) > 0) {
      puts("NO");
      return 0;
    }
  }
  puts("YES");
  return 0;
}
