#include <bits/stdc++.h>
using namespace std;
template <typename Tn>
Tn __lcm(Tn a, Tn b) {
  return a / __gcd(a, b) * b;
}
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
int main() {
  map<int, int> m;
  int a[100001];
  int n;
  cin >> n;
  vector<int> v;
  for (int i = (0); i < (n); i++) {
    cin >> a[i];
    if (!m[a[i]]) {
      v.push_back(a[i]);
      m[a[i]] = 1;
    } else {
      m[a[i]]++;
    }
  }
  if (v.size() == 3 && m[v[0]] == m[v[1]] && m[v[1]] == m[v[2]]) {
    cout << "Yes" << endl;
  } else if (v.size() == 2 && abs(m[v[0]] - m[v[1]]) == 1) {
    cout << "Yes" << endl;
  } else if (v.size() == 1 && v[0] == 0) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
