#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using pll = pair<ll, ll>;
const ll mod = static_cast<ll>(1e9) + 7;
int main() {
  ll N;
  cin >> N;
  vector<ll> A(N);
  for (auto& a : A) {
    cin >> a;
  }
  sort(A.begin(), A.end());
  ll x = -1, y = -1, z = -1;
  ll xn = 0, yn = 0, zn = 0;
  bool ok = true;
  for (const auto& a : A) {
    if (x == -1 || x == a) {
      x = a;
      ++xn;
    } else if (y == -1 || y == a) {
      y = a;
      ++yn;
    } else if (z == -1 || z == a) {
      z = a;
      ++zn;
    } else {
      ok = false;
    }
  }
  if (x == 0 && xn == N) {
    cout << "Yes" << endl;
    return 0;
  }
  if (x == 0 && yn != -1 && z == -1 && (N % 2) == 1 &&
      (xn + 1 == yn || xn * 2 == yn)) {
    cout << "Yes" << endl;
    return 0;
  }
  if (x == 0) {
    cout << "No" << endl;
    return 0;
  }
  if (x == -1 || y == -1 || z == -1) {
    ok = false;
  }
  if (!(xn == yn && yn == zn)) {
    ok = false;
  }
  if (!((x ^ z) == y && (y ^ x) == z && (z ^ y) == x)) {
    ok = false;
  }
  cout << (ok ? "Yes" : "No") << endl;
  return 0;
}
