#include <bits/stdc++.h>
using namespace std;
bool check(vector<long> vect) {
  int n = vect.size();
  for (int i = 1; i <= vect.size(); i++) {
    int x = vect[(i - 1) % n];
    int y = vect[(i + 1) % n];
    if ((x ^ y) == vect[i % n])
      continue;
    else
      return false;
  }
  return true;
}
int main() {
  int n;
  cin >> n;
  vector<long> vect;
  for (int i = 0; i < n; i++) {
    long x;
    cin >> x;
    vect.push_back(x);
  }
  if (check(vect))
    cout << "Yes";
  else
    cout << "No";
  return 0;
}
