#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
using namespace std;
template <class T>
istream &operator>>(istream &is, vector<T> &v) {
  for (T &a : v) is >> a;
  return is;
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  for (const T &t : v) os << t << " ";
  return os << endl;
}
template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &v) {
  return os << v.first << " " << v.second;
}
double gcd(double a, double b) { return a < 0.01 ? b : gcd(fmod(b, a), a); }
long long bpow(long long a, long long b, long long m) {
  a %= m;
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = res * a % m;
    a = a * a % m;
    b >>= 1;
  }
  return res;
}
long long int kv;
long long int t, n, x, y, h, k, z, p, q, w;
string s, s1, s2;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(16);
  ;
  cin >> n;
  map<long long int, long long int> m;
  for (long long i = 0; i < n; i++) cin >> x, m[x]++;
  if (n % 3 != 0) {
    if ((long long int)m.size() == 1 && m.begin()->first == 0)
      cout << "Yes";
    else
      cout << "No";
  } else {
    if ((long long int)m.size() == 3) {
      auto it = m.begin();
      x = it->first;
      if (it->second != n / 3) return cout << "No", 0;
      it++;
      y = it->first;
      if (it->second != n / 3) return cout << "No", 0;
      it++;
      z = it->first;
      if (it->second != n / 3) return cout << "No", 0;
      if ((x ^ y) == z)
        cout << "Yes";
      else
        cout << "No";
    } else if ((long long int)m.size() == 1) {
      if (m.begin()->first == 0)
        cout << "Yes";
      else
        cout << "No";
    } else if ((long long int)m.size() == 2) {
      auto it = m.begin();
      if (it->first != 0 || it->second != n / 3)
        return cout << "No", 0;
      else
        cout << "Yes";
    }
  }
  return 0;
}
