#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> vec(N);
  for (int i = 0; i < (int)(N); i++) {
    cin >> vec[i];
  }
  sort(vec.begin(), vec.end());
  bool ans = true;
  if (N % 3 != 0) {
    ans = false;
  } else {
    int small;
    int middle;
    int large;
    small = vec[0];
    middle = vec[N / 3];
    large = vec[(N / 3) * 2];
    for (int i = 0; i < (int)(N / 3); i++) {
      if (vec[i] != small) ans = false;
      if (vec[(N / 3) + i] != middle) ans = false;
      if (vec[(N / 3) * 2 + i] != large) ans = false;
    }
    if ((small ^ middle) != large) ans = false;
  }
  if (ans)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
