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