#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  bool judge = true;
  cin >> N;
  if (N % 3 != 0) {
    judge = false;
  }
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  sort(A.begin(), A.end());
  vector<int> count(N, 0);
  vector<int> num(N, 0);
  int k = 0;
  for (int j = 0; j < N; j++) {
    num[0] = A[0];
    if (j > 0 && A[j] != A[j - 1]) {
      k++;
      num[k] = A[j];
    }
    count[k]++;
  }
  if (!(count[0] == count[1] && count[1] == count[2] && count[3] == 0)) {
    judge = false;
  }
  if (!(num[0] ^ num[1] == num[2] && num[1] ^ num[2] == num[0] &&
        num[2] ^ num[0] == num[1])) {
    judge = false;
  }
  if (judge) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
