#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  bool flag = true;
  for (int i = 0; i < n; i++) {
    int l = (i + (n - 1)) % n;
    int r = (i + 1) % n;
    if (a[i] != (a[l] ^ a[r])) {
      flag = false;
      break;
    }
  }
  cout << (flag ? "Yes" : "No") << endl;
}
