#include <bits/stdc++.h>
using namespace std;
using ll = long long;
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;
}
int main() {
  int N;
  cin >> N;
  map<int, int> mp;
  for (int i = 0; i < (N); i++) {
    int tmp;
    cin >> tmp;
    mp[tmp]++;
  }
  if (mp.size() > 3)
    cout << "No" << endl;
  else if (mp.size() == 3 && !(N % 3)) {
    for (auto e : mp) {
      if (e.second != N / 3) {
        cout << "No" << endl;
        return 0;
      }
    }
    cout << "Yes" << endl;
  } else if (mp.size() == 2 && !(N % 3)) {
    if (mp[0] == N / 3)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else if (mp[0] == N)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
