#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i;
  int xx[100100];
  while (scanf("%d", &n) != EOF) {
    int temp;
    int max = 0;
    int min = 20000;
    memset(xx, 0, sizeof(xx));
    map<int, int> he;
    he.clear();
    for (i = 0; i < n; i++) {
      scanf("%d", &xx[i]);
      if (xx[i] >= max) max = xx[i];
      he[xx[i]] += 2;
    }
    bool ans = 1;
    map<int, int>::iterator pre = he.begin();
    for (map<int, int>::iterator it = ++he.begin(); it != he.end(); it++) {
      if (it->first != pre->first + 1) {
        ans = 0;
        break;
      }
      it->second = it->second - pre->second;
      if (it->second <= 0 && it->first != max) {
        ans = 0;
        break;
      }
      pre = it;
    }
    pre = --he.end();
    ans = ans && (pre->second == 0);
    ans ? printf("YES\n") : printf("NO\n");
  }
}
