#include <bits/stdc++.h>
using namespace std;
const long long INF = 2 * pow(10, 9) + 10;
const long long inf = pow(10, 18);
long long modulo = 163577857;
void deal() {
  long long n;
  cin >> n;
  map<long long, long long> all;
  for (long long i = 0; i < n; i++) {
    long long ed;
    cin >> ed;
    all[ed]++;
  }
  if (all.size() == 1) {
    if (all[0])
      cout << "Yes";
    else
      cout << "No";
    return;
  }
  if (n % 3 != 0) {
    cout << "No";
    return;
  }
  if (all.size() == 2) {
    auto it = all.begin();
    auto it1 = it;
    ++it1;
    if ((*it).first == 0 && (*it1).second == (*it).second * 2)
      cout << "Yes";
    else
      cout << "No";
    return;
  }
  if (all.size() == 3) {
    auto it = all.begin();
    auto it1 = it;
    ++it1;
    auto it2 = it1;
    ++it2;
    if (((*it).first == (*it1).first ^ (*it2).first) &&
        (*it1).second == (*it2).second && (*it2).second == (*it).second)
      cout << "Yes";
    else
      cout << "No";
    return;
  }
  cout << "No";
}
int main() { deal(); }
