#include <bits/stdc++.h>

using namespace std;

int main()
{
  uint64_t N;
  cin >> N;
  
  uint64_t M = N / 3;
  
  set<uint64_t> Aset;
  multiset<uint64_t> Amset;
  for (uint64_t n = 0; n < N; ++n) {
    uint64_t A;
    cin >> A;
    
    Aset.insert(A);
    Amset.insert(A);
  }
  
  uint64_t K = Aset.size();
  uint64_t A1 = *Aset.begin(); Aset.erase(Aset.begin());
  
  if (K == 1) && (A1 == 0)) {
    cout << "Yes" << endl;
    return 0;
  }
  
  if ((N % 3) != 0) {
    cout << "No" << endl;
    return 0;
  }

  if (K == 1) {
    cout << "No" << endl;
    return 0;
  } else if (K == 2) {
    if (A1 != 0) {
      cout << "No" << endl;
      return 0;
    }
    
    uint64_t C1 = Amset.count(A1);
    if (C1 != M) {
      cout << "No" << endl;
      return 0;
    }
    
    cout << "Yes" << endl;
  } else if (K == 3) {
    uint64_t A2 = *Aset.begin(); Aset.erase(Aset.begin());
    uint64_t A3 = *Aset.begin(); Aset.erase(Aset.begin());
    
    if ((A1 ^ A2 ^ A3) != 0) {
      cout << "No" << endl;
      return 0;
    }
    
    uint64_t C1 = Amset.count(A1);
    uint64_t C2 = Amset.count(A2);
    if ((C1 != M) || (C2 != M)) {
      cout << "No" << endl;
      return 0;
    }
    
    cout << "Yes" << endl;
  }
  
  return 0;
}