#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const string ln = "\n";
constexpr int INF = 1001001001;
constexpr int MOD = 1000000007;
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  ll n;
  cin >> n;
  vector<ll> a(n);
  map<ll, ll> m;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    m[a[i]]++;
  }
  string ans = "No";
  if (n % 3 == 0) {
    if (m.size() > 3) {
      ans = "No";
    } else if (m.size() == 3) {
      bool ok = true;
      for (auto p : m) {
        ll cnt = p.second;
        if (cnt != n / 3) {
          ok = false;
          break;
        }
      }
      ans = ok ? "Yes" : "No";
    } else if (m.size() == 2) {
      bool ok = true;
      ll zcnt = m[0];
      if (zcnt == n / 3) {
        ans = "Yes";
      } else {
        ans = "No";
      }
    } else {
      ans = m.find(0) != m.end() ? "Yes" : "No";
    }
  } else {
    bool ok = true;
    for (int i = 0; i < n; i++) {
      if (a[i] != 0) {
        ok = false;
      }
    }
    ans = ok ? "Yes" : "No";
  }
  cout << ans << ln;
  return 0;
}
