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