#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, count[3];
  long long temp;
  cin >> N;
  set<long long> S;
  map<long long, int> M;
  for (int i = 0; i < N; i++) {
    cin >> temp;
    S.insert(temp);
    if (M.find(temp) == M.end()) M[temp] = 1;
    M[temp]++;
  }
  if (S.size() == 1 && temp == 0)
    cout << "No" << endl;
  else if (M.find(0) != M.end() && M[0] == N / 3 * 2 && N % 3 == 0 &&
           S.size() == 2)
    cout << "Yes" << endl;
  else if (S.size() != 3)
    cout << "No" << endl;
  else {
    set<long long>::iterator it = S.begin();
    map<long long, int>::iterator mt = M.begin();
    int i = 0;
    for (; mt != M.end(); mt++) {
      count[i] = mt->second;
      i++;
    }
    long long a = *it;
    it++;
    long long b = *it;
    it++;
    long long c = *it;
    if (a ^ b ^ c == 0 && N % 3 == 0 && count[0] == N / 3 &&
        count[1] == N / 3 && count[2] == N / 3)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
