#include <bits/stdc++.h>
using namespace std;
bool solve(vector<int> A, long long N) {
  for (long long i = 0; i < 3; i++) {
    long long check = A[i * (N / 3)];
    for (long long 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;
}
bool newSolve(vector<int> A, long long N) {
  long long idx = 0;
  long long check = 0;
  for (long long i = 0; i < A.size(); i++) {
    if (A[i] != 0 && check == 0) {
      check = A[i];
      idx = i;
      break;
    }
  }
  if (!check) return true;
  if (idx * 3 != N) return false;
  for (long long i = idx; i < A.size(); i++) {
    if (A[i] != check) return false;
  }
  return true;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long N;
  cin >> N;
  vector<int> A(N);
  for (long long i = 0; i < N; i++) {
    cin >> A[i];
  }
  sort(A.begin(), A.end());
  if (A[0] == 0) {
    cout << (newSolve(A, N) ? "Yes" : "No") << endl;
  } else if (N % 3 != 0)
    cout << "No" << endl;
  else {
    cout << (solve(A, N) ? "Yes" : "No") << endl;
  }
}
