#include <bits/stdc++.h>
using namespace std;
int a[100005];
int cnt[100005];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  sort(a, a + n);
  int dx = a[0];
  int ret = 1;
  for (int i = 0; i < n; i++) {
    if (a[i] - dx > 100000 || (cnt[a[i] - dx - 1] == 0 && a[i] - dx != 0)) {
      ret = 0;
      break;
    }
    cnt[a[i] - dx]++;
  }
  if (ret == 0) {
    printf("NO\n");
    return 0;
  }
  int ma = a[n - 1] - dx;
  cnt[1] -= (cnt[0] - 1);
  for (int i = 1; i < ma; i++) {
    if (cnt[i] < 2) {
      printf("NO\n");
      return 0;
    }
    cnt[i + 1] -= (cnt[i] - 2);
  }
  if (cnt[ma] != 1)
    printf("NO\n");
  else
    printf("YES\n");
}
