#include <bits/stdc++.h>
int v[100100], c[100100], n;
int main() {
  scanf("%d", &n);
  if (n & 1)
    puts("NO");
  else {
    for (int i = 0; i < n; ++i) scanf("%d", v + i);
    std::sort(v, v + n);
    bool valid = v[n - 1] != v[0] && v[n - 1] - v[0] <= (n) / 2;
    if (!valid)
      puts("NO");
    else {
      for (int i = 0; i < n; ++i) ++c[v[i] - v[0]];
      int left = c[0] - 1;
      for (int i = 1; valid && i < v[n - 1] - v[0]; ++i) {
        valid &= (c[i] >= left + 2);
        left = c[i] - left - 2;
      }
      valid &= (c[v[n - 1] - v[0]] == left + 1);
      puts(valid ? "YES" : "NO");
    }
  }
  return 0;
}
