#include <bits/stdc++.h>
using namespace std;
int main(int argc, char* argv[]) {
  int N;
  cin >> N;
  vector<long long> A(N);
  int i;
  for (i = 0; i < N; i++) {
    cin >> A[i];
  }
  for (i = 0; i < N; i++) {
    long long x;
    int j = i + 2;
    j %= N;
    x = A[i] ^ A[j];
    int k = i + 1;
    k %= N;
    if (x != A[k]) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
