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