#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  map<int, int> M;
  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    M[a]++;
  }
  if (M[0] == N) {
    cout << "Yes" << endl;
    return 0;
  }
  if (M.size() > 3 || N % 3) {
    cout << "No" << endl;
    return 0;
  }
  vector<int> A;
  for (auto p : M) {
    if (p.second % 3) {
      cout << "No" << endl;
      return 0;
    }
    while (p.second) {
      A.push_back(p.first);
      p.second -= N / 3;
    }
  }
  if ((A[0] ^ A[1]) == A[2]) {
    cout << "Yes" << endl;
    return 0;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
