#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ul = unsigned;
using db = double;
const int maxn = 100001;
int n;
int a[maxn];
map<int, int> cnt;
bool valid() {
  if (cnt.count(0) and cnt.size() == 1) return true;
  if (cnt.size() > 3 || n % 3) return false;
  if (cnt.count(0)) {
    if (cnt.size() != 2) return false;
    return cnt[0] == n / 3 * 2 and cnt.rbegin()->second == n / 3;
  } else {
    vector<int> v;
    for (auto& i : cnt)
      if (i.second != n / 3)
        return false;
      else
        v.push_back(i.first);
    return ((v[0] ^ v[1]) == v[2]) || ((v[1] ^ v[2]) == v[0]) ||
           ((v[0] ^ v[2]) == v[1]);
  }
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> a[i];
  for (int i = 0; i < n; ++i) ++cnt[a[i]];
  if (valid())
    cout << "Yes\n";
  else
    cout << "No\n";
}
