#include <bits/stdc++.h>
using namespace std;
long long n, a, cnt;
map<long long, long long> m;
bool f = true;
vector<long long> v;
signed main() {
  cin >> n;
  for (long long i = 0; i < (long long)(n); ++i) cin >> a, m[a]++;
  cnt = m.begin()->second;
  for (auto i : m) {
    if (cnt != i.second) f = false;
    v.push_back(i.first);
  }
  if (v.size() < 3) {
    cout << "No" << endl;
    return 0;
  }
  if (v[0] != (v[1] ^ v[v.size() - 1])) f = false;
  if (v[v.size() - 1] != (v[0] ^ v[v.size() - 2])) f = false;
  for (long long i = 1; i < (long long)(v.size() - 1); ++i)
    if (v[i] != (v[i - 1] ^ v[i + 1])) f = false;
  if (f)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
