#include <bits/stdc++.h>
using namespace std;
int kaizyou(int x) {
  long int y = 1;
  for (int i = 1; i < x; i++) y *= i;
  return y;
}
int main() {
  int N;
  long a[100000] = {0}, b[100000] = {0};
  cin >> N;
  int i, flag, count = 0;
  for (i = 0; i < N; i++) cin >> a[i];
  vector<int> v(N);
  iota(v.begin(), v.end(), 0);
  do {
    flag = 0;
    for (i = 0; i < N; i++) b[i] = a[v[i]];
    for (i = 1; i < N - 1; i++) {
      if (b[i] != (b[i - 1] ^ b[i + 1])) {
        flag = 1;
      }
    }
    if ((b[0] != (b[N - 1] ^ b[1])) || (b[N - 1] != (b[N - 2] ^ b[0]))) {
      flag = 1;
    }
    if (flag == 0) {
      cout << "Yes" << endl;
      return 0;
    }
    count++;
  } while (next_permutation(v.begin(), v.end()) && count <= kaizyou(N) / N);
  cout << "No" << endl;
  return 0;
}
