#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int N;
  cin >> N;
  vector<ll> a(N);
  for (int((i)) = (0); ((i)) < ((N)); ((i))++) cin >> a[i];
  map<ll, ll> cnt;
  for (auto num : a) cnt[num]++;
  if (cnt.size() != 3) {
    cout << "No" << endl;
  } else {
    vector<ll> v;
    for (auto itr : cnt) v.push_back(itr.second);
    if (v[0] == v[1] && v[0] == v[2]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
