#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> a;
  int n;
  int i, j;
  int s = 1;
  cin >> n;
  for (i = 0; i < n; i++) {
    int an;
    cin >> an;
    a.emplace_back(an);
  }
  for (i = 1; i <= n; i++) {
    int e = a.at(0) ^ a.at(2);
    if (e != a.at(1)) {
      s = 0;
      break;
    }
    a.emplace_back(a.at(0));
    a.erase(a.begin());
  }
  if (s == 1) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
