#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < (int)(n); ++i) {
    cin >> a[i];
  }
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  map<int, int> three;
  for (int i = 0; i < (int)(n); ++i) {
    three[a[i]] = 0;
    if (three.size() > 3) {
      cout << "No" << endl;
      return 0;
    }
  }
  for (int i = 0; i < (int)(n); ++i) {
    three[a[i]]++;
  }
  for (auto itr = three.begin(); itr != three.end(); ++itr) {
    if (itr->second != (n / 3)) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
