#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  unsigned *a;
  a = new unsigned[n];
  for (unsigned i = 0; i < n; i++) {
    cin >> a[i];
  }
  unsigned *b;
  b = new unsigned[n];
  unsigned *idx;
  idx = new unsigned[n];
  for (int i = 0; i < n; i++) {
    idx[i] = i;
  }
  do {
    for (int i = 0; i < n; i++) {
      b[i] = a[idx[i]];
    }
    for (int i = 0; i < n; i++) {
      if (((i - 1) >= 0) && (i <= (n - 2))) {
        if ((b[i - 1] ^ b[i + 1]) == b[i]) {
          cout << "Yes" << endl;
          return 0;
        }
      }
      if (i == 0) {
        if ((b[1] ^ b[n - 1]) == b[i]) {
          cout << "Yes" << endl;
          return 0;
        }
      }
      if ((n - 1) == 0) {
        if ((b[n - 2] ^ b[1]) == b[i]) {
          cout << "Yes" << endl;
          return 0;
        }
      }
    }
  } while (next_permutation(idx, idx + n));
  cout << "No" << endl;
  return 0;
}
