#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmax(T &a, const T &b) {
  return (a < b) ? (a = b, 1) : 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  return (b < a) ? (a = b, 1) : 0;
}
using ll = long long;
using R = long double;
const R EPS = 1e-9L;
inline int sgn(const R &r) { return (r > EPS) - (r < -EPS); }
inline R sq(R x) { return sqrt(max(x, 0.0L)); }
void output(bool ok) {
  cout << (ok ? "Yes" : "No") << endl;
  exit(0);
}
int main(void) {
  int n;
  cin >> n;
  map<int, int> val;
  set<int> s;
  for (int i = int(0); i < int(n); ++i) {
    int a;
    cin >> a;
    s.insert(a);
    val[a]++;
  }
  vector<int> b;
  for (auto &elem : s) b.push_back(elem);
  if (b.size() == 1 and b[0] == 0) output(true);
  if (n % 3 != 0) output(false);
  if (b.size() == 3) {
    bool same = true;
    for (int i = int(0); i < int(3); ++i)
      if (val[b[i]] != val[b[0]]) same = false;
    if (same == false) output(false);
    if ((b[0] ^ b[1]) != b[2]) output(false);
    output(true);
  } else if (b.size() == 2) {
    if (b[0] != 0) output(false);
    if (val[b[0]] * 2 != val[b[1]]) output(false);
    output(true);
  }
  return 0;
}
