#include <bits/stdc++.h>
using namespace std;
using ll = long long;
bool solve(vector<ll> k, vector<ll> n) {
  if (k.size() == 1) {
    if (k[0] == 0) {
      return true;
    }
  } else if (k.size() == 2) {
    if (k[0] == 0) {
      if (2 * n[0] == n[1]) {
        return true;
      }
    } else if (k[1] == 0) {
      if (2 * n[1] == n[0]) {
        return true;
      }
    }
  } else if (k.size() == 3) {
    if (k[0] ^ k[1] == k[2] && n[0] == n[1] && n[1] == n[2]) {
      return true;
    }
  }
  return false;
}
int main() {
  ll N;
  cin >> N;
  ll a;
  map<ll, int> c;
  for (int i = 0; i < N; i++) {
    cin >> a;
    c[a]++;
  }
  vector<ll> k, n;
  for (auto p : c) {
    k.push_back(p.first);
    n.push_back(p.second);
  }
  string ans = solve(k, n) ? "Yes" : "No";
  cout << ans << "\n";
  return 0;
}
