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