#include <bits/stdc++.h>
using namespace std;
using VP = vector<pair<long long, long long> >;
using VVP = vector<VP>;
using VI = vector<long long>;
using VVI = vector<VI>;
using VVVI = vector<VVI>;
const int inf = 1e9 + 7;
const long long INF = 1LL << 61;
const long long mod = 1e9 + 7;
template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int i, j;
  int n;
  cin >> n;
  if (n % 3 != 0) {
    bool ng = 0;
    for (i = 0; i < n; i++) {
      int a;
      cin >> a;
      if (a != 0) ng = 1;
    }
    if (ng)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  } else {
    set<int> st;
    map<int, int> ma;
    for (i = 0; i < n; i++) {
      int a;
      cin >> a;
      ma[a]++;
      st.insert(a);
    }
    if (st.size() == 1) {
      if (ma[0] == n) cout << "Yes" << endl;
      return 0;
    }
    if (st.size() == 2) {
      if (ma[0] == n / 3) cout << "Yes" << endl;
      return 0;
    }
    if (st.size() == 3) {
      int x = 0;
      bool ok = 1;
      for (auto it = ma.begin(); it != ma.end(); ++it) {
        x ^= it->first;
        if (it->second != n / 3) ok = 0;
      }
      if (ok && x == 0) {
        cout << "Yes" << endl;
        return 0;
      }
    }
    cout << "No" << endl;
  }
}
