#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned int a;
  cin >> a;
  bool flag = true;
  vector<unsigned int> b(a);
  for (size_t i = 0; i < a; i++) {
    cin >> b[i];
  }
  if (!((b[1] ^ b[b.size() - 1]) == b[0])) {
    flag = false;
  }
  for (size_t i = 1; i < b.size() - 1; i++) {
    if (!((b[i - 1] ^ b[i + 1]) == b[i])) {
      flag = false;
    }
  }
  if (!((b[b.size() - 2] ^ b[0]) == b[b.size() - 1])) {
    flag = false;
  }
  if (flag) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
