#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
ll gcd(ll a, ll b) {
  ll tmp;
  if (b > a) {
    tmp = a;
    a = b;
    b = tmp;
  }
  while (a % b != 0) {
    tmp = b;
    b = a % b;
    a = tmp;
  }
  return b;
}
const int MAX = 2000;
long long fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (int i = 2; i < MAX; i++) {
    fac[i] = fac[i - 1] * i % 1000000007;
    inv[i] = 1000000007 - inv[1000000007 % i] * (1000000007 / i) % 1000000007;
    finv[i] = finv[i - 1] * inv[i] % 1000000007;
  }
}
long long COM(int n, int k) {
  if (n < k) return 0;
  if (n < 0 || k < 0) return 0;
  return fac[n] * (finv[k] * finv[n - k] % 1000000007) % 1000000007;
}
void sosuu(ll n, vector<ll> &v) {
  vector<ll> num(n, 0);
  for (ll i = (1); i <= (sqrt(n)); i++) {
    if (num[i] == 0) {
      for (ll j = (0); j <= (n / i); j++) {
        num[i + (j * i)] = 1;
      }
    }
  }
  for (ll i = 0; i < (ll)(n); i++) {
    if (num[i] == 0) v.push_back(i + 1);
  }
}
ll GetDigit(ll num) {
  ll digit = 0;
  while (num != 0) {
    num /= 10;
    digit++;
  }
  return digit;
}
int main(void) {
  ll n;
  cin >> n;
  map<ll, ll> m;
  for (ll i = 0; i < (ll)(n); i++) {
    ll x;
    cin >> x;
    m[x]++;
  }
  if (m.size() > 3) {
    cout << "No" << endl;
    return 0;
  } else if (m.size() == 1) {
    decltype(m)::iterator it = m.find(0);
    if (it == m.end()) {
      cout << "No" << endl;
      return 0;
    }
  } else if (m.size() == 2) {
    if (m[0] != n / 3 || n % 3 != 0) {
      cout << "No" << endl;
      return 0;
    }
  } else {
    if (n % 3 != 0) {
      cout << "No" << endl;
      return 0;
    }
    for (auto i = m.begin(); i != m.end(); i++) {
      if (i->second != n / 3) {
        cout << "No" << endl;
        return 0;
      }
    }
  }
  cout << "Yes" << endl;
  return 0;
}
