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