#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long n;
  cin >> n;
  n -= 1;
  vector<unsigned long> a(n, 0);
  unsigned long top;
  cin >> top;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  unsigned long* p = a.data();
  do {
    if ((top ^ p[1]) != p[0]) {
      goto A;
    }
    if ((top ^ p[n - 2]) != p[n - 1]) {
      goto A;
    }
    if ((p[0] ^ p[n - 1]) != top) {
      goto A;
    }
    for (int i = 0; i < n - 2; i++) {
      if ((p[i] ^ p[i + 2]) != p[i + 1]) {
        goto A;
      }
    }
    cout << "Yes";
    return 0;
  A:
    0;
  } while (std::next_permutation(p, p + n));
  cout << "No";
}
