#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
const ll mod = 1e9 + 7;
const ll inf = 1e18;
void yes() {
  cout << ("Yes") << endl;
  exit(0);
}
void no() {
  cout << ("No") << endl;
  exit(0);
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll N;
  cin >> N;
  vector<ll> A(N);
  for (ll i = (0); i < (N); ++i) {
    cin >> A.at(i);
  }
  ll zero_count = 0;
  for (ll a : A) {
    if (a == 0) zero_count++;
  }
  if (zero_count == N) {
    yes();
  }
  if (zero_count > 0) {
    no();
  }
  map<ll, ll> mp;
  for (ll a : A) {
    mp[a]++;
  }
  if (N % 3 != 0) {
    no();
  }
  if (mp.size() == 3) {
    ll x = 0;
    for (auto pa : mp) {
      ll count = pa.second;
      if (count != N / 3) {
        no();
      }
      x ^= pa.first;
    }
    if (x == 0) {
      yes();
    } else {
      no();
    }
  } else if (mp.size() == 2) {
    if (mp[0] == N / 3) {
      yes();
    } else {
      no();
    }
  } else {
    no();
  }
  return 0;
}
