#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 n;
  cin >> n;
  vector<ll> A(n);
  for (int i = 0; i < (n); i++) {
    cin >> A[i];
  }
  sort((A).begin(), (A).end());
  int kind = 1;
  vector<ll> B(3);
  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]) {
      kind++;
      if (kind > 3) {
        cout << "No" << endl;
        break;
      }
      int K = A[i + 1];
      B.at(kind - 1) = K;
    }
  }
  if (kind > 3) {
  } else if (kind == 3) {
    ll bin = B[0] ^ B[1] ^ B[2];
    if (n % 3 == 0 && bin == 0 && M[B[0]] == n / 3 && M[B[1]] == n / 3 &&
        M[B[2]] == n / 3) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else if (kind == 2) {
    if (B[0] == 0 && M[0] == n / 3 && M[B[1]] == n / 3 * 2) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else if (kind == 1) {
    if (B[0] == 0) {
      cout << "Yes" << endl;
    }
  }
}
