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