#include <bits/stdc++.h>
using namespace std;
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;
}
const double PI = 3.14159265358979323846;
int mod = 1e9 + 7;
int INF = 1e9 + 7;
int main() {
  int N;
  cin >> N;
  map<int, int> mp;
  for (ll i = 0; i < (N); ++i) {
    int a;
    cin >> a;
    mp[a]++;
  }
  vector<P> vect;
  for (P p : mp) {
    vect.push_back(p);
  }
  sort(vect.begin(), vect.end());
  bool ok = false;
  if (int(vect.size()) == 1)
    if (vect[0].first == 0) ok = true;
  if (int(vect.size()) == 2) {
    int cnt_0 = vect[0].second;
    int cnt_1 = vect[0].second;
    if (cnt_0 == 2 * cnt_1 || 2 * cnt_0 == cnt_1) {
      ok = true;
    }
  }
  if (int(vect.size()) == 3) {
    if (vect[0].second * 3 == N && vect[1].second * 3 == N &&
        vect[2].second * 3 == N) {
      int x = vect[0].first;
      int y = vect[1].first;
      int z = vect[2].first;
      if (x == (y ^ z) && y == (x ^ z) && z == (x ^ y)) ok = true;
    }
  }
  if (ok) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
