#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3FFFFFFF;
const long long INFLL = 0x3FFFFFFF3FFFFFFF;
const double INFD = 1.0e+308;
const double EPS = 1.0e-9;
void YesNo(bool b) { cout << (b ? "Yes" : "No") << endl; }
void YESNO(bool b) { cout << (b ? "YES" : "NO") << endl; }
template <class T, class U>
istream& operator>>(istream& ist, pair<T, U>& right) {
  return ist >> right.first >> right.second;
}
template <class T, class U>
ostream& operator<<(ostream& ost, const pair<T, U>& right) {
  return ost << right.first << ' ' << right.second;
}
template <class T, class TCompatible, size_t N>
void Fill(T (&dest)[N], const TCompatible& val) {
  fill(dest, dest + N, val);
}
template <class T, class TCompatible, size_t M, size_t N>
void Fill(T (&dest)[M][N], const TCompatible& val) {
  for (int i = 0; i < M; ++i) Fill(dest[i], val);
}
template <class T>
T Compare(T left, T right) {
  return left > right ? 1 : (left < right ? -1 : 0);
}
istream& Ignore(istream& ist) {
  string s;
  ist >> s;
  return ist;
}
bool Inside(int i, int j, int h, int w) {
  return i >= 0 && i < h && j >= 0 && j < w;
}
template <class T>
T Next() {
  T buf;
  cin >> buf;
  return buf;
}
istream& operator>>(istream& ist, __int128& val) {
  long long tmp;
  ist >> tmp;
  val = tmp;
  return ist;
}
ostream& operator<<(ostream& ost, __int128 val) {
  long long tmp = val;
  ost << tmp;
  return ost;
}
template <typename T>
using PriorityQ = priority_queue<T, vector<T>, greater<T> >;
int N;
int A[100000];
bool sub() {
  if (N % 3 != 0) return false;
  map<int, int> mp;
  for (long long i = (0), i_max = (N); i < i_max; ++i) {
    mp[A[i]]++;
  }
  vector<int> v;
  for (auto p : mp) {
    if (p.second % (N / 3) != 0) return false;
    for (long long z = (0), z_max = (p.second / (N / 3)); z < z_max; ++z) {
      v.push_back(p.first);
    }
  }
  return (v[0] ^ v[1]) == v[2];
}
int main() {
  cin >> N;
  for (long long i = (0), i_max = (N); i < i_max; ++i) {
    cin >> A[i];
  }
  YesNo(sub());
  return 0;
}
