#include <bits/stdc++.h>
using namespace std;
bool solve(vector<int> A, int N) {
  sort(A.begin(), A.end());
  for (int i = 0; i < 3; i++) {
    int check = A[i * (N / 3)];
    for (int j = 0; j < (N / 3); j++) {
      if (A[i * (N / 3) + j] != check) return false;
    }
  }
  if (A[1 * (N / 3)] ^ A[2 * (N / 3)] == A[0])
    return true;
  else
    return false;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  if (N % 3 != 0)
    cout << "No" << endl;
  else {
    cout << (solve(A, N) ? "Yes" : "No") << endl;
  }
}
