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