#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using V = vector<int>;
using VV = vector<V>;
using VVV = vector<VV>;
using VL = vector<ll>;
using VVL = vector<VL>;
using VVVL = vector<VVL>;
template <class T>
using VE = vector<T>;
template <class T>
using P = pair<T, T>;
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;
}
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
const ll MOD = 1e9 + 7;
ll upper = MOD + MOD;
ll under = -upper;
ll UPPER = MOD * MOD;
ll UNDER = -UPPER;
const long double pi = 3.141592653589793;
int main() {
  int n;
  cin >> n;
  V a(n);
  for (int i = 0; i < (n); i++) {
    cin >> a[i];
  }
  sort((a).begin(), (a).end());
  V b = a;
  b.erase(unique((b).begin(), (b).end()), b.end());
  if (b.size() >= 4) {
    cout << "No" << endl;
    return 0;
  }
  map<int, int> mp;
  for (int i = 0; i < (n); i++) {
    mp[a[i]]++;
  }
  if (mp[0] == n) {
    cout << "Yes" << endl;
    return 0;
  } else {
    if (n % 3 != 0) {
      cout << "No" << endl;
      return 0;
    } else {
      if (mp.size() == 2) {
        int cnt = mp[0];
        int cnt2 = mp[b[1]];
        if (cnt2 == cnt * 2)
          cout << "Yes" << endl;
        else
          cout << "No" << endl;
      } else {
        if ((b[0] ^ b[1] == b[2])) {
          int cnt = mp[b[0]];
          int cnt2 = mp[b[1]];
          int cnt3 = mp[b[2]];
          if (cnt == cnt2 && cnt2 == cnt3)
            cout << "Yes" << endl;
          else
            cout << "No" << endl;
        } else
          cout << "No" << endl;
      }
    }
  }
  return 0;
}
