#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  map<int, int> m;
  for (int i = 1, x; i <= n; i++) {
    cin >> x;
    m[x]++;
  }
  if (n % 3 != 0) {
    if (m.size() == 1)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else {
    for (auto it : m)
      if (it.second % (n / 3) != 0) {
        cout << "No" << endl;
        return 0;
      }
    cout << "Yes" << endl;
  }
}
