#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> da(n);
  for (int i = 0; i < n; i++) {
    cin >> da[i];
  }
  map<int, int> dic;
  for (int i = 0; i < n; i++) {
    if (dic.count(da[i])) {
      dic[da[i]]++;
    } else {
      dic[da[i]] = 1;
    }
  }
  bool ju = bool(n % 3);
  if (dic.size() == 3) {
    for (auto i : dic) {
      if (i.second != n / 3) {
        ju = true;
        break;
      }
    }
  } else {
    ju = true;
  }
  if (ju) {
    cout << "No" << endl;
  } else {
    cout << "Yes" << endl;
  }
}
