#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<long long, long long>;
constexpr char ln = '\n';
constexpr long long MOD = 1000000007LL;
constexpr long long INF = 1000000009LL;
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;
}
int main() {
  int n;
  cin >> n;
  if (n % 3 != 0)
    cout << "No" << ln;
  else {
    bool fg = true;
    map<int, int> mp;
    for (int i = 0; i < (n); i++) {
      int a;
      cin >> a;
      mp[a]++;
    }
    if (mp.size() != 3)
      fg = false;
    else {
      vector<int> key, val;
      for (auto m : mp) {
        key.push_back(m.first);
        val.push_back(m.second);
      }
      if (val[0] != val[1] || val[1] != val[2] || val[2] != val[0]) {
        fg = false;
      }
      int xor_ = key[0] ^ key[1];
      if (xor_ != key[2]) fg = false;
    }
    if (fg)
      cout << "Yes" << ln;
    else
      cout << "No" << ln;
  }
}
