#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N;
  cin >> N;
  if (N % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  map<long long, int> mp;
  for (int i = 0; i < N; i++) {
    long long tmp;
    cin >> tmp;
    mp[tmp]++;
  }
  int divN = N / 3;
  bool ret = true;
  for (auto i = mp.begin(); i != mp.end(); ++i) {
    if (i->second != divN) {
      ret = false;
      break;
    }
  }
  if (ret)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
