#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pi = pair<int, int>;
constexpr ll mod = 1000000007;
void pPRINTl(ostream& ost) { ost << endl; }
template <class T>
void pPRINTL(ostream& ost, T t) {
  ost << t << endl;
}
template <class T, class... U>
void pPRINTl(ostream& ost, T t, U... u) {
  ost << t << " ";
  pPRINTl(ost, u...);
}
template <class... T>
void PRINTl(T... t) {}
void pPRINT(ostream& ost) {}
template <class T>
void pPRINT(ostream& ost, T t) {
  ost << t;
}
template <class T, class... U>
void pPRINT(ostream& ost, T t, U... u) {
  ost << t << " ";
  pPRINT(ost, u...);
}
template <class... T>
void PRINT(T... t) {
  pPRINT(cout, t...);
}
int main() {
  ll n;
  cin >> n;
  ll a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  ll p[n];
  for (int i = 0; i < n; i++) p[i] = -1;
  function<bool(ll, ll)> func = [&](ll l, ll s) -> bool {
    ll r = a[l] ^ a[s];
    p[s] = p[l] + 1;
    if (p[s] == n - 1) {
      PRINTl(l, s, ":", a[l], a[s], r, "i", 0, "a[i]", a[0], "p[i]", p[0]);
      if (r == a[0]) {
        PRINTl("searching end");
        return true;
      } else {
        p[s] = -1;
        return false;
      }
    }
    for (int i = 0; i < n; i++) {
      PRINTl(l, s, ":", a[l], a[s], r, "i", i, "a[i]", a[i], "p[i]", p[i]);
      if (i != l && i != n && a[i] == r && p[i] < 0) {
        PRINTl(a[l], a[s], a[i], "match");
        if (func(s, i)) return true;
      }
    }
    p[s] = -1;
    return false;
  };
  bool f = false;
  p[0] = 0;
  for (int i = 1; i < n; i++) {
    f = func(0, i);
    if (f) break;
  }
  if (f)
    PRINT("Yes");
  else
    PRINT("No");
  return 0;
}
