#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmin(T& a, T b);
template <class T>
inline bool chmax(T& a, T b);
template <typename T>
ostream& operator<<(ostream& s, const vector<T>& v);
template <class T>
int64_t sum(vector<T> a);
template <class T>
double ave(vector<T> a);
int64_t n, k;
int64_t h, w;
int main() {
  cin >> n;
  vector<uint64_t> a(n);
  for (int i = 0; i < (int)(n); i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  if (a[n - 1] == 0) {
    cout << "Yes" << endl;
    return 0;
  }
  bool success = false;
  int64_t c1, c2, c3;
  if (n % 3 == 0) {
    c1 = a[0];
    auto itr = lower_bound(a.begin(), a.end(), c1 + 1);
    size_t pos = std::distance(a.begin(), itr);
    if (pos != n && n == pos * 3) {
      c2 = a[pos];
      itr = lower_bound(a.begin(), a.end(), c2 + 1);
      pos = std::distance(a.begin(), itr);
      if (pos != n && n * 2 == pos * 3) {
        c3 = a[pos];
        itr = lower_bound(a.begin(), a.end(), c3 + 1);
        if (itr == a.end() && (c1 ^ c2) == c3) {
          cout << "Yes" << endl;
          return 0;
        }
      }
    }
  }
  cout << "No" << endl;
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
ostream& operator<<(ostream& s, const vector<T>& v) {
  int len = v.size();
  for (int i = 0; i < len; ++i) {
    s << v[i];
    if (i < len - 1) s << "\t";
  }
  return s;
}
