#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n;
  cin >> n;
  map<long long, long long> mp;
  for (long long i = 0; i < n; i++) {
    long long a;
    cin >> a;
    mp[a]++;
  }
  if (n % 3 != 0) {
    if (mp.size() == 1 && mp.begin()->first == 0) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  if (n % 3 == 0) {
    auto itr = mp.begin();
    if (itr->first == 0 && mp.size() == 1) {
      cout << "Yes" << endl;
      return 0;
    } else if (itr->first == 0 && itr->second == 3 / n && mp.size() == 2) {
      cout << "Yes" << endl;
      return 0;
    }
    pair<long long, long long> p1 = make_pair(itr->first, itr->second);
    pair<long long, long long> p2 =
        make_pair(next(itr)->first, next(itr)->second);
    pair<long long, long long> p3 =
        make_pair(next(itr, 2)->first, next(itr, 2)->second);
    if (p1.second == p2.second == p3.second) {
      if ((p1.first ^ p2.first) == p3.first &&
          (p2.first ^ p3.first) == p1.first &&
          (p3.first ^ p1.first) == p2.first) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;
  return 0;
}
