#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 (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
const ll mod = 1e9 + 7;
const int INF = 1e9;
const ll INFLONG = 1e18;
int main() {
  ll n;
  cin >> n;
  ll a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  bool can;
  if (n % 3 != 0) {
    if (a[n] == 0) {
      can = true;
    } else {
      can = false;
    }
  } else {
    can = true;
    ll tmp;
    for (int i = 0; i < n; i++) {
      if (i % (n / 3) == 0) {
        tmp = a[i];
      } else {
        if (tmp != a[i]) {
          can = false;
          break;
        }
      }
    }
    if ((a[0] ^ a[n / 3] ^ a[n / 3 * 2]) != 0) {
      can = false;
    }
  }
  can = true;
  if (can) {
    cout << "Yes";
  } else {
    cout << "No";
  }
}
