#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  cin >> N;
  if (N % 3) {
    cout << "No" << endl;
    return 0;
  }
  vector<long long> A(N);
  for (long long i = 0; i < N; i++) cin >> A[i];
  vector<pair<long long, long long>> triple;
  for (long long i = 0; i < N; i++) {
    bool exist = false;
    for (long long j = 0; j < triple.size(); j++) {
      if (A[i] == triple[j].second) {
        triple[j].first++;
        exist = true;
      }
    }
    if (exist == false) {
      triple.emplace_back(1, A[i]);
    }
    if (triple.size() > 3) {
      cout << "No" << endl;
      return 0;
    }
  }
  if (triple[0].first != triple[1].first ||
      triple[2].first != triple[1].first ||
      (triple[0].second ^ triple[1].second ^ triple[2].second) != 0) {
    cout << "No" << endl;
    return 0;
  } else {
    cout << "Yes" << endl;
    return 0;
  }
}
