#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
const long long MOD = 1e9 + 7;
const long long INF = 1e18;
const double pi = acos(-1);
int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1};
int dy[8] = {0, 1, 0, -1, -1, 1, 1, -1};
const int MAX = 510000;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  map<int, int> mp;
  for (int i = 0; i < n; ++i) mp[a[i]]++;
  bool ok = true;
  if (mp.size() == 1) {
    if (*max_element(a.begin(), a.end()) == 0)
      ok = true;
    else
      ok = false;
    if (ok)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
    return 0;
  } else if (mp.size() == 2) {
    int x = -1, y = -1;
    for (auto p : mp) {
      if (x == -1)
        x = p.second;
      else
        y = p.second;
    }
    if (x > y) swap(x, y);
    if (n % 3 == 0 && mp[x] == n / 3 && x == 0 && mp[y] == 2 * n / 3)
      ok = true;
    else
      ok = false;
    if (ok)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
    return 0;
  } else if (mp.size() == 3) {
    int x = -1, y = -1, z = -1;
    for (auto p : mp) {
      if (x == -1)
        x = p.second;
      else if (y == -1)
        y = p.second;
      else
        z = p.second;
    }
    if (n % 3 == 0 && mp[x] == n / 3 && mp[y] == n / 3 && mp[z] == n / 3)
      ok = true;
    else
      ok = false;
    if (ok)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
    return 0;
  }
  return 0;
}
