#include <bits/stdc++.h>
using namespace std;
template <class C>
inline bool in_(const typename C::key_type& k, const C& A) {
  return A.find(k) != A.end();
}
inline bool in_(const string& s, const string& S) {
  return S.find(s) != string::npos;
}
int main() {
  ios::sync_with_stdio(false);
  int n;
  while (cin >> n) {
    map<int, int> cnt;
    for (int i = (0); i < (n); ++i) {
      int a;
      cin >> a;
      cnt[a]++;
    }
    bool good = false;
    if (n % 3 == 0) {
      if (cnt.size() == 1 && cnt.begin()->first == 0) good = true;
      if (cnt.size() == 2) {
        const pair<int, int> x = *cnt.begin();
        const pair<int, int> y = *cnt.rbegin();
        good = x.first == 0 && y.second == 2 * n / 3;
      }
      if (cnt.size() == 3) {
        const pair<int, int> x = *cnt.begin();
        const pair<int, int> y = *++cnt.begin();
        const pair<int, int> z = *++ ++cnt.begin();
        good = (x.first ^ y.first ^ z.first) == 0 && x.second == n / 3 &&
               y.second == n / 3 && z.second == n / 3;
      }
    }
    cout << (good ? "Yes" : "No") << endl;
  }
  return 0;
}
