#include <bits/stdc++.h>
using namespace std;
signed main() {
  int n;
  cin >> n;
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  map<int, int> f;
  vector<int> c;
  for (int i : a) {
    f[i]++;
    if (f[i] == (n / 3)) {
      c.push_back(i);
      f[i] = 0;
    }
  }
  bool good = true;
  if (c.size() != 3) good = false;
  if (good) {
    good = c[0] ^ c[1] ^ c[2];
    good = !good;
  }
  if (!good) {
    cout << "No" << endl;
  } else {
    cout << "Yes" << endl;
  }
}
