#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const int INF = 1e9;
const double EPS = 1e-9;
const ll MOD = 1e9 + 7;
const string YES = "Yes";
const string NO = "No";
int main() {
  long long N;
  scanf("%lld", &N);
  std::vector<long long> a(N);
  map<ll, ll> mp;
  for (int i = 0; i < N; i++) {
    scanf("%lld", &a[i]);
    mp[a[i]]++;
  }
  sort(a.begin(), a.end());
  if (mp.size() == 1) {
    if (mp[0] > 0)
      cout << YES << endl;
    else
      cout << NO << endl;
  } else if (mp.size() == 2 && N % 3 == 0) {
    if (a[0] == 0 && mp[a[0]] == N / 3 && mp[a[N / 3]] == 2 * N / 3)
      cout << YES << endl;
    else
      cout << NO << endl;
  } else if (mp.size() == 3 && N % 3 == 0) {
    bool flag = true;
    ll t = -1;
    for (auto &e : mp) {
      if (e.second == 0) continue;
      if (t < 0) t = e.second;
      if (t != e.second) flag = false;
    }
    if (flag)
      cout << YES << endl;
    else
      cout << NO << endl;
  } else
    cout << NO << endl;
  return 0;
}
