#include <bits/stdc++.h>
using namespace std;
const long long INF = 1ll << 50;
long long n;
long long a[100000];
unordered_map<long long, long long> m;
int main() {
  cin >> n;
  for (long long i = 0; i < n; i++) cin >> a[i];
  if (n % 3 == 0) {
    for (long long i = 0; i < n; i++) {
      m[a[i]]++;
    }
    for (auto x : m) {
      if (x.second % (n / 3) != 0) {
        cout << "No" << endl;
        return 0;
      }
    }
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
