#include <bits/stdc++.h>
template <typename T1, typename T2>
std::ostream& operator<<(std::ostream& os, const std::pair<T1, T2>& p) {
  return os << "(" << p.first << ", " << p.second << ")";
}
template <typename C>
std::ostream& _debug_go(std::ostream& os, const C& v) {
  bool first = true;
  os << "[";
  for (auto i : v) {
    if (!first) os << ", ";
    os << i;
    first = false;
  }
  return os << "]";
}
template <typename T>
std::ostream& operator<<(std::ostream& os, const std::vector<T>& v) {
  return _debug_go(os, v);
}
template <typename T>
std::ostream& operator<<(std::ostream& os, const std::set<T>& v) {
  return _debug_go(os, v);
}
template <typename T1, typename T2>
std::ostream& operator<<(std::ostream& os, const std::map<T1, T2>& v) {
  return _debug_go(os, v);
}
struct Debugger {
  template <typename T>
  Debugger& operator,(const T& v) {
    std::cerr << v << " ";
    return *this;
  }
} dbg;
using namespace std;
using ui = uint32_t;
using ll = int64_t;
using ull = uint64_t;
template <typename T = int>
using Pt = complex<T>;
template <typename T>
T cross(const Pt<T>& a, const Pt<T>& b) {
  return a.real() * b.imag() - a.imag() * b.real();
}
template <typename T>
bool cmpPt(const Pt<T>& a, const Pt<T>& b) {
  return a.real() < b.real() || (a.real() == b.real() && a.imag() < b.imag());
}
bool solve(const int N, const vector<int>& A) {
  map<int, int> ct;
  for (int a : A) ++ct[a];
  if (ct.size() > 3) return false;
  vector<int> xs, ns;
  for (auto kv : ct) xs.push_back(kv.first), ns.push_back(kv.second);
  if (!all_of(ns.begin() + 1, ns.end(), [&](int n) { return n == ns[0]; })) {
    return false;
  }
  if (ct.size() <= 2) return ct.begin()->first == 0;
  return xs[2] == (xs[0] ^ xs[1]);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int N;
  cin >> N;
  vector<int> A(N);
  for (int& a : A) cin >> a;
  cout << (solve(N, A) ? "Yes" : "No") << '\n';
  return 0;
}
