#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  long a[N];
  for (int i = 0; i < N; i++) {
    cin >> a[i];
  }
  bool result = true;
  for (int i = 0; i < N; i++) {
    int left, right;
    if (i == 0) {
      left = N - 1;
    } else {
      left = i - 1;
    }
    if (i == N - 1) {
      right = 0;
    } else {
      right = i + 1;
    }
    if ((a[left] ^ a[right]) != a[i]) {
      result = false;
      break;
    }
  }
  cout << (result ? "Yes" : "No") << endl;
  return 0;
}
