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