#include <bits/stdc++.h>
using namespace std;
template <class T>
void chmin(T &a, const T &b) {
  if (a > b) a = b;
}
template <class T>
void chmax(T &a, const T &b) {
  if (a < b) a = b;
}
template <class T>
using MaxHeap = priority_queue<T>;
template <class T>
using MinHeap = priority_queue<T, vector<T>, greater<T>>;
template <class T>
vector<T> vect(int len, T elem) {
  return vector<T>(len, elem);
}
template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
  os << p.first << ',' << p.second;
  return os;
}
template <class T, class U>
istream &operator>>(istream &is, pair<T, U> &p) {
  is >> p.first >> p.second;
  return is;
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  for (int i = 0; i < vec.size(); i++) {
    os << vec[i];
    if (i + 1 < vec.size()) os << ' ';
  }
  return os;
}
template <class T>
istream &operator>>(istream &is, vector<T> &vec) {
  for (int i = 0; i < vec.size(); i++) is >> vec[i];
  return is;
}
void fastio() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  cout << fixed << setprecision(20);
}
void solve() {
  int N;
  cin >> N;
  vector<int> a(N);
  cin >> a;
  sort((a).begin(), (a).end());
  vector<pair<int, int>> rl;
  for (int i = 0; i < N; i++) {
    if (rl.empty() || rl.back().first != a[i]) {
      rl.emplace_back(a[i], 1);
    } else {
      rl.back().second++;
    }
  }
  vector<int> x;
  bool judge = true;
  for (auto val : rl) {
    int t = val.second / (N / 3);
    if (val.second != t * (N / 3)) judge = false;
    for (int i = 0; i < t; i++) x.push_back(val.first);
  }
  if (a.size() % 3 != 0 || rl.size() > 3 || x.size() != 3 || !judge) {
    cout << "No"
         << "\n";
    return;
  }
  if ((x[0] ^ x[1]) == x[2])
    cout << "Yes"
         << "\n";
  else
    cout << "No"
         << "\n";
  return;
}
signed main() {
  fastio();
  solve();
  return 0;
}
