#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vec = vector<ll>;
using mat = vector<vec>;
using pll = pair<ll, ll>;
int main() {
  ll N;
  cin >> N;
  multiset<ll> C;
  set<ll> D;
  for (ll(i) = (0), (i_len) = (N); (i) < (i_len); ++(i)) {
    ll a;
    cin >> a;
    C.insert(a);
    D.insert(a);
  }
  bool f = false;
  if (N % 3 != 0) {
    if (C.count(0) == N) f = true;
  } else {
    if (C.count(0) == N) f = true;
    if (((ll)(D).size()) == 2 && C.count(0) == N / 3) f = true;
    if (((ll)(D).size()) == 3) {
      bool g = true;
      for (auto(d) : D) {
        if (C.count(d) != N / 3) g = false;
      }
      f = g;
    }
  }
  if (f)
    cout << ("Yes") << endl;
  else
    cout << ("No") << endl;
  return 0;
}
