#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int INF = 1000000000;
using ll = long long;
const long long lINF = ll(1e18) + 5;
unsigned gcd(unsigned a, unsigned b) {
  if (a < b) return gcd(b, a);
  unsigned r;
  while ((r = a % b)) {
    a = b;
    b = r;
  }
  return b;
}
unsigned lcm(unsigned a, unsigned b) { return a / gcd(a, b) * b; }
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  ll N;
  cin >> N;
  if (N % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  map<ll, ll> cnt;
  for (int i = 0, i_len = (N); i < i_len; ++i) {
    ll x;
    cin >> x;
    cnt[x]++;
  }
  bool flag = false;
  if (cnt.size() == 3) {
    ll a[3];
    ll b[3];
    ll c = 0;
    for (auto d : cnt) {
      b[c] = d.second;
      a[c] = d.first;
      c++;
    }
    sort(b, b + 3);
    if ((a[0] ^ a[1]) == a[2] && (a[0] ^ a[2]) == a[1] &&
        (a[1] ^ a[2]) == a[0]) {
      if (b[0] == b[1] && b[1] == b[2]) flag = true;
    }
  } else if (cnt.size() == 2) {
    ll a[2];
    ll b[2];
    ll c = 0;
    for (auto d : cnt) {
      b[c] = d.second;
      a[c] = d.first;
      c++;
    }
    sort(b, b + 2);
    sort(a, a + 2);
    if (a[0] == 0 && b[0] == b[1] * 2) flag = true;
  } else if (cnt.size() == 1) {
    if (cnt[0] == N) flag = true;
  }
  flag ? cout << "Yes" << endl : cout << "No" << endl;
}
