#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
void sayNo() { cout << "No" << endl; }
void sayYes() { cout << "Yes" << endl; }
int main() {
  long long N;
  cin >> N;
  vector<int> s(N);
  unordered_map<int, int> map;
  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    map[a]++;
  }
  int count = 0;
  int A[3];
  int num[3];
  for (auto itr = map.begin(); itr != map.end(); ++itr) {
    auto key = itr->first;
    auto val = itr->second;
    A[count] = key;
    num[count] = val;
    count++;
    if (count > 3) {
      sayNo();
      return 0;
    }
  }
  if (count == 1) {
    if ((A[0] ^ A[0]) == A[0]) {
      sayYes();
    } else {
      sayNo();
    }
    return 0;
  }
  if (count == 2) {
    sayNo();
    return 0;
  }
  auto a01 = A[0] ^ A[1];
  auto a02 = A[0] ^ A[2];
  auto a12 = A[1] ^ A[2];
  if (a01 == A[2] || a02 == A[1] || a12 == A[0]) {
    if (N % 3 == 0 && num[0] == num[1] && num[1] == num[2]) {
      sayYes();
      return 0;
    }
  }
  sayNo();
  return 0;
}
