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