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