#include <bits/stdc++.h>
using namespace std;
inline void fileio(const char* in, const char* out) {
  freopen(in, "r", stdin);
  freopen(out, "w", stdout);
}
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> VI;
typedef vector<bool> VB;
typedef vector<ll> VL;
const char nl = '\n';
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fll;
const ld EPS = 1e-9, PI = acos(-1);
void fail() {
  cout << "No" << nl;
  exit(0);
}
int main() {
  atexit([]() { cerr << "Time: " << (ld)clock() / CLOCKS_PER_SEC << nl; });
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  map<int, int> cnt;
  VI nums(n);
  for (int i = 0; i < (n); ++i) {
    cin >> nums[i];
    cnt[nums[i]]++;
    if (cnt.size() > 3) fail();
  }
  int num = -1;
  for (auto it = cnt.begin(); it != cnt.end(); it++) {
    if (num == -1) {
      num = it->second;
    } else {
      if (num != it->second) fail();
    }
  }
  if (cnt.size() == 1) {
    if (!cnt.count(0)) fail();
  } else if (cnt.size() == 2) {
    fail();
  } else {
    auto it = cnt.begin();
    int v = it->first;
    it++;
    v ^= it->first;
    it++;
    if (v != it->first) fail();
  }
  cout << "Yes" << nl;
  return 0;
}
