#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
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;
}
const ll INF = 1LL << 60;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  map<int, int> mp;
  for (ll i = 0; i < (ll)(n); i++) {
    cin >> a[i];
    mp[a[i]]++;
    if (mp.size() > 3) {
      cout << "No" << endl;
      return 0;
    }
  }
  if (mp[0] == n) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n % 3 != 0) {
    cout << "No" << endl;
  } else {
    for (auto p : mp) {
      if (p.second % (n / 3) != 0 || p.second == n) {
        cout << "No" << endl;
        return 0;
      }
    }
    cout << "Yes" << endl;
  }
  return 0;
}
