#include <bits/stdc++.h>
using namespace std;
map<long long, long long> mp;
vector<long long> types;
signed main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  long long n;
  cin >> n;
  bool nonzero = false;
  for (long long i = 0; i < n; i++) {
    long long x;
    cin >> x;
    if (x) nonzero = true;
    mp[x]++;
  }
  if (!nonzero) {
    cout << "Yes";
    exit(0);
  }
  if (n % 3 != 0) {
    cout << "No";
    exit(0);
  }
  for (auto x : mp) {
    types.push_back(x.first);
  }
  if (types.size() == 1) {
    cout << "No";
    exit(0);
  }
  if (types.size() > 3) {
    cout << "No";
    exit(0);
  }
  if (types.size() == 2) {
    if (types[0] != 0 || types[1] != 0) {
      cout << "No";
      exit(0);
    }
    long long other = types[0] ? types[0] : types[1];
    if (mp[other] != mp[0] * 2) {
      cout << "No";
      exit(0);
    }
    cout << "Yes";
    exit(0);
  }
  assert(types.size() == 3);
  if (mp[types[0]] == mp[types[1]] && mp[types[1]] == mp[types[2]]) {
    if ((types[0] ^ types[1]) == types[2] &&
        (types[0] ^ types[2]) == types[1]) {
      cout << "Yes";
      exit(0);
    } else {
      cout << "No";
      exit(0);
    }
  } else {
    cout << "No";
    exit(0);
  }
  assert(false);
  return 0;
}
