#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using unit = unsigned;
using ull = unsigned long long;
using P = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vp = vector<P>;
void _main();
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  _main();
}
template <class T>
string join(const vector<T> &v) {
  stringstream s;
  for (int i = (int)(0); i < (int)((int)(v).size()); ++i) s << ' ' << v[i];
  return s.str().substr(1);
}
template <class T>
inline ostream &operator<<(ostream &o, const vector<T> &v) {
  if ((int)(v).size()) o << join(v);
  return o;
}
template <class T1, class T2>
inline ostream &operator<<(ostream &o, const pair<T1, T2> &v) {
  return o << v.first << "," << v.second;
}
template <class T>
void YES(T condition) {
  if (condition)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
template <class T>
void Yes(T condition) {
  if (condition)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
template <class T>
void POSS(T condition) {
  if (condition)
    cout << "POSSIBLE" << endl;
  else
    cout << "IMPOSSIBLE" << endl;
}
template <class T>
void Poss(T condition) {
  if (condition)
    cout << "Possible" << endl;
  else
    cout << "Impossible" << endl;
}
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
T gcd(T a, T b) {
  if (b == 0) {
    return a;
  } else {
    return gcd(b, a % b);
  }
}
template <class T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
constexpr double eps = 1e-10;
constexpr int inf = INT_MAX / 2;
constexpr ll infl = 1LL << 60;
void _main() {
  int N;
  cin >> N;
  vi a(N);
  for (int i = (int)(0); i < (int)(N); ++i) cin >> a[i];
  sort((a).begin(), (a).end());
  bool f = false;
  do {
    for (int i = (int)(1); i < (int)(N - 1); ++i) {
      if ((a[i - 1] ^ a[i + 1]) != a[i]) continue;
    }
    if ((a[N - 1] ^ a[1]) != a[0]) continue;
    if ((a[N - 2] ^ a[0]) != a[N - 1]) continue;
    f = true;
    break;
  } while (std::next_permutation((a).begin(), (a).end()));
  Yes(f);
}
