#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  map<int, int> cnt;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    cnt[a[i]]++;
  }
  string ret = "Yes";
  set<int> s;
  for (int i = 0; i < n; i++) {
    if (cnt[a[i]] != n / 3) {
      ret = "No";
    }
    s.insert(a[i]);
  }
  if (s.size() != 3) {
    ret = "No";
  } else {
    auto itr = s.begin();
    int p = *itr, q = *(++itr), r = *(++itr);
    if ((p ^ r) != q) ret = "No";
    if ((q ^ p) != r) ret = "No";
    if ((r ^ q) != p) ret = "No";
  }
  cout << ret << endl;
}
