#include <bits/stdc++.h>
using namespace std;
int ara[100005], freq[100005];
map<int, int> mp;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &ara[i]);
  sort(ara, ara + n);
  bool f = 1;
  for (int i = 1; i < n && f; i++)
    if ((ara[i] - ara[i - 1]) > 1) f = 0;
  int cnt = 0;
  for (int i = 0; i < n && f; i++) {
    if (!mp[ara[i]]) mp[ara[i]] = ++cnt;
    ara[i] = mp[ara[i]];
    freq[ara[i]]++;
  }
  if (cnt == 1)
    puts("NO");
  else if (cnt == 2) {
    if (f && freq[1] == freq[2])
      puts("YES");
    else
      puts("NO");
  } else {
    for (int i = 2; i < cnt; i++) freq[i]--;
    for (int i = 1; i < cnt && f; i++) {
      if (!freq[i + 1]) f = 0;
      for (int j = 0; j < freq[i] && f; j++) {
        if (!freq[i + 1])
          f = 0;
        else
          freq[i + 1]--;
      }
      freq[i] = 0;
      if (i + 1 != cnt) freq[i + 1]++;
    }
    for (int i = 1; i <= cnt && f; i++)
      if (freq[i]) f = 0;
    if (f)
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}
