#include <bits/stdc++.h>
using namespace std;
int64_t mod = 1e9 + 7;
int64_t INF = 1e18;
double EPS = 0.00000001;
int main() {
  int64_t n;
  cin >> n;
  vector<int64_t> a(n);
  map<int64_t, int64_t> mp;
  for (int64_t i = 0; i < n; i++) {
    cin >> a[i];
    mp[a[i]]++;
  }
  if ((int64_t)mp.size() != 3 || n % 3 != 0) {
    cout << ("No") << endl;
    return 0;
  }
  bool check = true;
  for (auto i : mp) {
    if (i.second != n / 3) check = false;
  }
  cout << (check ? "Yes" : "No") << endl;
  return 0;
}
