#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> a;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  a.resize(n);
  for (auto &i : a) cin >> i;
  set<int> s(a.begin(), a.end());
  if (s.size() == 2 || s.size() > 3) return cout << "No" << endl, 0;
  if (s.size() == 1 && *s.begin() != 0) return cout << "No" << endl, 0;
  map<int, int> cnt;
  for (auto &i : a) cnt[i]++;
  int mn = 1e9, mx = 0;
  for (auto &i : cnt) {
    mn = min(mn, i.second);
    mx = max(mx, i.second);
  }
  if (mx - mn > 1) return cout << "No" << endl, 0;
  cout << "Yes" << endl;
}
