#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
using ll = long long;
using P = pair<int, int>;
template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
istream &operator>>(istream &is, vector<T> &v) {
  for (int i = 0; i < (int)v.size(); i++) cin >> v.at(i);
  return is;
}
template <class T, class U>
ostream &operator<<(ostream &os, pair<T, U> p) {
  cout << '(' << p.first << ", " << p.second << ')';
  return os;
}
template <class T>
void print(const vector<T> &v, const string &delimiter = " ") {
  for (int i = 0; i < (int)(v.size()); i++)
    cout << (0 < i ? delimiter : "") << v.at(i);
  cout << endl;
}
template <class T>
void print(const vector<vector<T>> &vv, const string &delimiter) {
  for (const auto &v : vv) print(v, delimiter);
}
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  cin >> a;
  if (n % 3 == 0) {
    map<int, int> mp;
    for (int i = 0; i < (int)(n); i++) mp[a[i]]++;
    if (mp.size() == 1) {
      if (mp[0] != n)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    } else if (mp.size() == 2) {
      auto ite1 = mp.begin();
      auto ite2 = ++mp.begin();
      if ((ite1->second == n / 3 || ite1->second == n / 3 * 2) &&
          (ite1->first == 0 || ite2->first == 0)) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    } else if (mp.size() == 3) {
      P ps[3];
      int idx = 0;
      for (auto p : mp) ps[idx++] = p;
      if (ps[0].first ^ ps[1].first == ps[2].first) {
        cout << "Yes" << endl;
      } else
        cout << "No" << endl;
    } else if (3 < mp.size()) {
      cout << "No" << endl;
    }
  } else {
    for (int i = 0; i < (int)(n); i++) {
      if (a[i] != 0) {
        cout << "No" << endl;
        return 0;
      }
    }
    cout << "Yes" << endl;
  }
}
