#include <bits/stdc++.h>
using namespace std;
map<int, int> my;
int main() {
  int n = 0, in = 0, ax = 0, x = 0, i = 0, now = 0, big = 0;
  while (scanf("%d", &n) == 1) {
    my.clear();
    in = 1000000001;
    ax = 0;
    for (i = 0; i < n; i++) {
      scanf("%d", &x);
      my[x]++;
      if (x > ax) {
        ax = x;
      }
      if (x < in) {
        in = x;
      }
    }
    for (i = in; i <= ax; i++) {
      now = my[i];
      if (i != in && i != ax) {
        if (now < 2) {
          break;
        }
        now -= 2;
        big = my[i + 1];
        if (big < now) {
          break;
        }
        big -= now;
        my[i + 1] = big;
      } else {
        if (now < 1) {
          break;
        }
        now -= 1;
        big = my[i + 1];
        if (big < now) {
          break;
        }
        big -= now;
        my[i + 1] = big;
      }
    }
    if (i <= ax) {
      printf("NO\n");
    } else {
      printf("YES\n");
    }
  }
  return 0;
}
