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