#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int64_t> a(n);
  for (int i = 0; i < (int)(n); i++) {
    cin >> a[i];
  }
  vector<int64_t> b(n);
  for (int i = 1; i <= n - 2; i++) {
    b[i] = ((a[i - 1]) ^ (a[i + 1]));
  }
  b[0] = (a[1] ^ a[n - 1]);
  b[n - 1] = (a[n - 2]) ^ (a[0]);
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  bool ans = true;
  for (int i = 0; i < (int)(n); i++) {
    if (a[i] != b[i]) {
      ans = false;
      break;
    }
  }
  if (ans) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
