#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmax(T& a, const T& b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T& a, const T& b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  long long int n;
  cin >> n;
  long long int c[3];
  c[0] = c[1] = c[2] = 0;
  set<long long int> a;
  for (long long int i = 0; i < (long long int)(n); i++) {
    long long int t;
    cin >> t;
    if (a.find(t) == a.end()) {
      a.insert(t);
      if (a.size() > 3) {
        cout << "No" << endl;
        return 0;
      }
      c[a.size() - 1]++;
    } else
      c[distance(a.begin(), a.find(t))]++;
  }
  if (a.size() == 1 && *a.begin() == 0)
    cout << "Yes" << endl;
  else if (a.size() == 2 && (c[0] / 2 == c[1] || c[1] / 2 == c[0]) &&
           *a.begin() == 0)
    cout << "Yes" << endl;
  else if (c[0] == c[1] && c[1] == c[2])
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
