#include <bits/stdc++.h>
using namespace std;
long long n;
vector<long long> a, s;
map<long long, long long> mp;
bool solve();
int main() {
  cin >> n;
  a.resize(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  if (solve())
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
bool solve() {
  for (int i = 0; i < n; ++i) ++mp[a[i]];
  sort(a.begin(), a.end());
  a.erase(unique(a.begin(), a.end()), a.end());
  if (mp.size() == 1 && a[0] == 0) return 1;
  if (mp.size() != 3) return 0;
  bool ch = 1;
  for (int i = 0; i < 3; ++i)
    for (int j = 0; j < 3; ++j)
      for (int k = 0; k < 3; ++k) {
        if (a[i] != (a[j] ^ a[k]) && i != j && j != k && k != i) ch = 1;
      }
  if (!ch) return 0;
  if (n % 3 == 0 && mp[a[0]] == n / 3 && mp[a[1]] == n / 3 && mp[a[2]] == n / 3)
    return 1;
  return 0;
}
