#include <bits/stdc++.h>
using namespace std;
inline void YesNo(bool b) { cout << (b ? "Yes" : "No") << endl; }
inline void YESNO(bool b) { cout << (b ? "YES" : "NO") << endl; }
inline void Yay(bool b) { cout << (b ? "Yay!" : ":(") << endl; }
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << setprecision(15);
  int N;
  cin >> N;
  long long v[N];
  map<long long, int> mp;
  for (int i = 0, i_max = (N); i < i_max; ++i) {
    cin >> v[i];
    if (mp.count(v[i]))
      mp[v[i]] = 0;
    else
      ++mp[v[i]];
  }
  bool issat = false;
  long long s = v[0];
  long long n;
  long long p;
  for (int i = (1), i_max = (N); i < i_max; ++i) {
    if (mp.count(s ^ v[i])) {
      n = v[i];
      p = n ^ s;
      issat = true;
      break;
    }
  }
  if (!issat) {
    cout << "No" << endl;
    return 0;
  }
  --mp[n];
  --mp[p];
  for (int i = 0, i_max = (N - 2); i < i_max; ++i) {
    if (mp.count(n ^ p) && mp[n ^ p] > 0) {
      swap(n, p);
      n ^= p;
      --mp[n];
    } else {
      issat = false;
      break;
    }
  }
  if (n != s) issat = false;
  YesNo(issat);
  return 0;
}
