#include <bits/stdc++.h>
using namespace std;
template <class T>
constexpr T lcm(T m, T n) {
  return m / __gcd(m, n) * n;
}
template <typename I>
void join(ostream &ost, I s, I t, string d = " ") {
  for (auto i = s; i != t; ++i) {
    if (i != s) ost << d;
    ost << *i;
  }
  ost << endl;
}
template <typename T>
istream &operator>>(istream &is, vector<T> &v) {
  for (auto &a : v) is >> a;
  return is;
}
template <typename T, typename U>
istream &operator>>(istream &is, pair<T, U> &p) {
  is >> p.first >> p.second;
  return is;
}
template <typename T, typename U>
bool chmin(T &a, const U &b) {
  return (a > b ? a = b, true : false);
}
template <typename T, typename U>
bool chmax(T &a, const U &b) {
  return (a < b ? a = b, true : false);
}
template <typename T, size_t N, typename U>
void fill_array(T (&a)[N], const U &v) {
  fill((U *)a, (U *)(a + N), v);
}
bool solve(int n, vector<int> a) {
  if (n % 3) return false;
  map<int, int> c;
  for (auto x : a) {
    ++c[x];
  }
  vector<int> b;
  for (auto &kv : c) {
    if (kv.second % (n / 3) == 0) {
      for (long long int i = (0); i < (kv.second / (n / 3)); ++i)
        b.push_back(kv.first);
    } else {
      return false;
    }
  }
  if ((b[0] ^ b[1]) == b[2]) {
    return true;
  }
  return false;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  while (cin >> n) {
    vector<int> a(n);
    cin >> a;
    bool ans = solve(n, a);
    cout << (ans ? "Yes" : "No") << endl;
  }
  return 0;
}
