#include <bits/stdc++.h>
const int mod = 1e9 + 7;
const int inf = 1 << 20;
const long long INF = 1LL << 60;
using namespace std;
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  bool can = true;
  for (int i = 0; i < n; i++) {
    int x = i;
    int y = i + 2;
    if (y > n - 1) y -= n;
    if ((a[x] ^ a[y]) != a[(x + 1) % n]) {
      can = false;
    }
  }
  if (can) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
