#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
bool IsInt(double a) {
  int b = a / 1;
  if (a == b) {
    return true;
  } else {
    return false;
  }
}
int main() {
  int judge;
  int n;
  cin >> n;
  vector<ll> A(n);
  for (int i = 0; i < (n); i++) {
    cin >> A[i];
  }
  sort((A).begin(), (A).end());
  vector<ll> B(1);
  B[0] = A[0];
  map<ll, ll> M;
  M[A[0]]++;
  for (int i = 0; i < (n - 1); i++) {
    M[A[i + 1]]++;
    if (A[i + 1] != A[i]) {
      B.push_back(A[i + 1]);
    }
  }
  if (n % 3 == 0) {
    if (B.size() == 1 && B[0] == 0) judge = 1;
  } else if (B.size() > 3)
    judge = 0;
  else if (B.size() == 3) {
    ll bin = B[0] ^ B[1] ^ B[2];
    if (bin == 0 && M[B[0]] == n / 3 && M[B[1]] == n / 3 && M[B[2]] == n / 3) {
      judge = 1;
    }
  } else if (B.size() == 2) {
    if (M[B[0]] == n / 3) judge = 1;
  } else if (B.size() == 1) {
    if (B[0] == 0) judge = 1;
  }
  if (judge)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
