#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll n;
  cin >> n;
  ll a[n];
  for (ll i = 0; i < n; i++) {
    cin >> a[i];
  }
  ll x = -1, y = -1, z = -1;
  x = a[0];
  for (ll i = 1; i < n; i++) {
    if (a[i] != x) {
      y = a[i];
    }
  }
  for (ll i = 1; i < n; i++) {
    if (a[i] != x && a[i] != y) {
      z = a[i];
    }
  }
  for (ll i = 1; i < n; i++) {
    if (a[i] != x && a[i] != y && a[i] != z) {
      cout << "No" << endl;
      return 0;
    }
  }
  bool zeroflag = true;
  for (ll i = 0; i < n; i++) {
    if (a[i] != 0) zeroflag = false;
  }
  if (zeroflag) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  ll ans = 0;
  if (x >= 0) ans ^= x;
  if (y >= 0) ans ^= y;
  if (z >= 0) ans ^= z;
  if (ans == 0) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
