#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <class T>
void chmin(T &a, const T &b) noexcept {
  if (b < a) a = b;
}
template <class T>
void chmax(T &a, const T &b) noexcept {
  if (a < b) a = b;
}
void debug_out() { cout << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cout << H << " ";
  debug_out(T...);
}
int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(15);
  int n;
  cin >> n;
  vector<ll> a(n);
  unordered_map<ll, int> mp;
  for (int i = 0; i < (n); ++i) {
    cin >> a[i];
    if (mp.count(a[i]) == 0)
      mp[a[i]] = 1;
    else
      mp[a[i]]++;
  }
  auto no = [&]() {
    cout << "No\n";
    return 0;
  };
  auto yes = [&]() {
    cout << "Yes\n";
    return 0;
  };
  ;
  if (mp.size() == 1) {
    if (mp[0] == n)
      yes();
    else
      no();
  }
  if (mp.size() > 3 || n % 3 != 0)
    no();
  else if (mp.size() == 2) {
    if (mp[0] == n / 3)
      yes();
    else
      no();
  } else {
    bool ok = true;
    for (auto p : mp) {
      if (p.second != n / 3) ok = false;
    }
    if (ok)
      yes();
    else
      no();
  }
  return 0;
}
