#include <bits/stdc++.h>
using namespace std;
using i64 = int64_t;
const int inf = 1.01e9;
const i64 inf64 = 4.01e18;
const double eps = 1e-9;
template <typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
  os << "(" << p.first << ", " << p.second << ")";
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  os << "[";
  for (const auto &v : vec) {
    os << v << ",";
  }
  os << "]";
  return os;
}
template <typename T>
bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <typename A, typename T, size_t size>
void fill(A (&ary)[size], const T &val) {
  fill((T *)ary, (T *)(ary + size), val);
}
void solve() {
  i64 N;
  cin >> N;
  vector<i64> a(N);
  for (i64 i = i64(0), i_max_for_repmacro = i64(N); i < i_max_for_repmacro; ++i)
    cin >> a[i];
  map<i64, i64> cnt;
  for (i64 i = i64(0), i_max_for_repmacro = i64(N); i < i_max_for_repmacro; ++i)
    ++cnt[a[i]];
  if (cnt.size() == 1) {
    if (cnt[0] == N)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
    return;
  }
  if (cnt.size() == 2) {
    if (N == 3 and cnt[0] == 1)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
    return;
  }
  if (cnt.size() != 3) {
    cout << "No" << endl;
    return;
  }
  if (N % 3 != 0) {
    cout << "No" << endl;
    return;
  }
  vector<i64> v;
  for (auto p : cnt) {
    v.emplace_back(p.first);
  }
  for (i64 i = i64(0), i_max_for_repmacro = i64(v.size());
       i < i_max_for_repmacro; ++i) {
    if (cnt[v[i]] * 3 != N) {
      cout << "No" << endl;
      return;
    }
  }
  if ((v[0] != (v[1] ^ v[2])) and (v[1] != (v[0] ^ v[2])) and
      (v[2] != (v[0] ^ v[1]))) {
    cout << "No" << endl;
    return;
  }
  cout << "Yes" << endl;
}
int main() {
  std::cin.tie(0);
  std::ios::sync_with_stdio(false);
  cout.setf(ios::fixed);
  cout.precision(16);
  solve();
  return 0;
}
