#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
template <class T>
inline void chmin(T& a, T b) {
  if (a > b) {
    a = b;
  }
}
template <class T>
inline void chmax(T& a, T b) {
  if (a < b) {
    a = b;
  }
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  vector<long long> a(N);
  for (int(i) = 0; (i) < (N); (i)++) cin >> a[i];
  sort(a.begin(), a.end());
  bool ok = 1;
  if (N % 3 != 0) ok = 0;
  if (N / 3 != count(a.begin(), a.end(), a[0])) ok = 0;
  if (N / 3 != count(a.begin(), a.end(), a[N / 3])) ok = 0;
  if (N / 3 != count(a.begin(), a.end(), a[N - 1])) ok = 0;
  if (ok) {
    cout << "Yes"
         << "\n";
  } else {
    cout << "No"
         << "\n";
  }
}
