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