#include <bits/stdc++.h>
using namespace std;
const int MM = 1000000000;
const int MOD = MM + 7;
const int MAX = 510000;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
const long long INF = 1LL << 60;
const double pi = acos(-1.0);
int main() {
  long long n;
  cin >> n;
  vector<int> a(n);
  for (long long i = 0; i < n; i++) cin >> a[i];
  map<int, int> s;
  for (long long i = 0; i < n; i++) s[a[i]]++;
  if (s.size() > 3) {
    cout << "No" << endl;
    return 0;
  }
  if (s.size() == 3) {
    if (n % 3 == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
    return 0;
  }
  if (s.size() == 2) {
    if ((*s.begin()).first == 0 && (*s.begin()).second == n / 3) {
      if ((*(s.begin()++)).second == 2 * n / 3) {
        cout << "Yes" << endl;
        return 0;
      }
    }
    cout << "No" << endl;
    return 0;
  }
  if (s.count(0))
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
