#include <bits/stdc++.h>
using namespace std;
void yes() {
  cout << "Yes" << endl;
  exit(0);
}
void no() {
  cout << "No" << endl;
  exit(0);
}
int main() {
  int N;
  cin >> N;
  map<int, int> M;
  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    M[a]++;
  }
  if (N % 3) {
    if (M.size() == 1 && M.begin()->first == 0) {
      yes();
    }
  } else {
    if (M.size() == 1 && M.begin()->first == 0) {
      yes();
    }
    if (M.size() == 2 && M[0] == N / 3) {
      yes();
    }
    if (M.size() == 3) {
      auto it = M.begin();
      int a = it->first;
      ++it;
      int b = it->first;
      ++it;
      int c = it->first;
      if ((a ^ b) == c) yes();
    }
  }
  no();
  return 0;
}
