#include <bits/stdc++.h>
using namespace std;
using Int = long long;
template <typename T1, typename T2>
inline void chmin(T1 &a, T2 b) {
  if (a > b) a = b;
}
template <typename T1, typename T2>
inline void chmax(T1 &a, T2 b) {
  if (a < b) a = b;
}
template <typename T>
void drop(const T &x) {
  cout << x << endl;
  exit(0);
}
signed main() {
  Int n;
  cin >> n;
  vector<Int> as(n);
  for (Int i = 0; i < n; i++) cin >> as[i];
  map<Int, Int> cnt;
  for (Int a : as) cnt[a]++;
  if (cnt.size() > 3u) drop("No");
  vector<Int> vs;
  for (auto p : cnt) vs.emplace_back(p.first);
  for (Int x : vs) {
    for (Int y : vs) {
      auto check = cnt;
      vector<Int> zs(n + 2);
      zs[0] = x;
      check[zs[0]]--;
      zs[1] = y;
      check[zs[1]]--;
      for (Int i = 2; i < n; i++) {
        zs[i] = zs[i - 1] ^ zs[i - 2];
        check[zs[i]]--;
      }
      zs[n + 0] = x;
      zs[n + 1] = y;
      Int ok = 1;
      for (auto p : check) ok &= p.second == 0;
      for (Int i = 1; i < n + 2; i++) ok &= zs[i] == (zs[i - 1] ^ zs[i + 1]);
      if (ok) drop("Yes");
    }
  }
  drop("No");
  return 0;
}
