#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
ll mod = 1000000007;
void yorn(bool a) {
  if (a)
    cout << "Yes";
  else
    cout << "No";
  cout << endl;
}
int main() {
  ll n;
  cin >> n;
  set<ll> s;
  vll cnt(100001, 0);
  for (int i = 0; i < n; i++) {
    ll a;
    cin >> a;
    cnt.at(a)++;
    s.insert(a);
  }
  if (s.size() == 1) {
    yorn(cnt.at(0) != 0);
    return 0;
  }
  if (s.size() == 2) {
    yorn(n % 3 == 0 && cnt.at(0) == n / 3);
    return 0;
  }
  if (s.size() == 3) {
    if (n % 3 != 0)
      yorn(0);
    else {
      bool ok = true;
      for (int i = 0; i < 100001; i++)
        if (cnt.at(i) != 0 && cnt.at(i) != n / 3) ok = false;
      yorn(ok);
    }
    return 0;
  }
  yorn(0);
}
