#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vb = vector<bool>;
using vl = vector<long>;
using vs = vector<string>;
using vvi = vector<vector<int>>;
using vvb = vector<vector<bool>>;
using vvc = vector<vector<char>>;
using vvl = vector<vector<long>>;
using pii = pair<int, int>;
using pil = pair<int, long>;
using pll = pair<long, long>;
using vc = vector<char>;
int main() {
  int n;
  cin >> n;
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  int m = n / 3;
  vl a(n);
  for (int i = 0; i < (int)(n); i++) cin >> a.at(i);
  sort(a.begin(), a.end());
  long comp1 = a.at(0);
  for (int i = 0; i < (int)(m); i++) {
    if (a.at(i) != comp1) {
      cout << "No" << endl;
      return 0;
    }
  }
  long comp2 = a.at(m);
  for (int i = m; i < 2 * m; i++) {
    if (a.at(i) != comp2) {
      cout << "No" << endl;
      return 0;
    }
  }
  long comp3 = a.at(2 * m);
  for (int i = 2 * m; i < 3 * m; i++) {
    if (a.at(i) != comp3) {
      cout << "No" << endl;
      return 0;
    }
  }
  if (comp1 ^ comp2 ^ comp3)
    cout << "No" << endl;
  else
    cout << "Yes" << endl;
}
