#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<long long> hat(N);
  for (int i = 0; i < N; i++) cin >> hat[i];
  do {
    vector<long long> xors(N);
    bool fal = false;
    xors[0] = hat[1] ^ hat[N - 1];
    if (xors[0] > hat[N - 1]) continue;
    long long min = xors[0];
    int minInd = 0;
    for (int i = 1; i < N - 1; i++) {
      xors[i] = hat[i - 1] ^ hat[i + 1];
      if (xors[i] > hat[N - 1] || xors[i] < hat[0]) {
        fal = true;
        break;
      }
      if (xors[i] < min) {
        min = xors[i];
        minInd = i;
      }
    }
    if (fal) continue;
    xors[N - 1] = hat[N - 2] ^ hat[0];
    int ind = minInd;
    for (int count = 0; count < N; count++) {
      if (ind > N) ind = 0;
      if (xors[ind] != hat[count]) {
        fal = true;
        break;
      }
      ind += 1;
    }
    if (fal)
      continue;
    else {
      cout << "Yes" << endl;
      return 0;
    }
  } while (next_permutation(hat.begin() + 1, hat.end()));
  cout << "No" << endl;
  return 0;
}
