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