#include <algorithm>
#include <array>
#include <cmath>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

void input() {}
template <class T, class... Ts> void input(T &a, Ts &... as) {
  cin >> a;
  input(as...);
}
template <class V> istream &operator>>(istream &i, vector<V> &a) {
  for (auto &e : a)
    i >> e;
  return i;
}

void print() { cout << endl; }
template <class T> void print(T const &a) { cout << a << endl; }
template <class T, class... Ts> void print(T const &a, Ts const &... as) {
  cout << a << " ";
  print(as...);
}
using OS = ostream;
template <class F, class S> OS &operator<<(OS &o, pair<F, S> const &pair) {
  return o << "(" << pair.first << " : " << pair.second << ")";
}
template <size_t I, size_t N, class... Ts> struct OutputTuple;
template <> struct OutputTuple<1, 0> {
  OS &operator()(OS &o, tuple<> const &t) { return o; }
};
template <size_t N, class... Ts> struct OutputTuple<N, N, Ts...> {
  OS &operator()(OS &o, tuple<Ts...> const &t) { return o << get<N - 1>(t); }
};
template <size_t I, size_t N, class... Ts> struct OutputTuple {
  OS &operator()(OS &o, tuple<Ts...> const &t) {
    return OutputTuple<I + 1, N, Ts...>{}(o << get<I - 1>(t) << ",", t);
  }
};
template <class... Ts> OS &operator<<(OS &o, tuple<Ts...> const &t) {
  return OutputTuple<1, sizeof...(Ts), Ts...>{}(o << "(", t) << ")";
}
template <class C> ostream &outputContainer(OS &o, C const &a) {
  o << "[";
  for (auto i = a.begin(), e = a.end(); i != e; o << ((++i != e) ? ", " : ""))
    o << *i;
  return o << "]";
}
template <class V> OS &operator<<(OS &o, list<V> const &a) {
  return outputContainer(o, a);
}
template <class V> OS &operator<<(OS &o, vector<V> const &a) {
  return outputContainer(o, a);
}
template <class V> OS &operator<<(OS &o, set<V> const &a) {
  return outputContainer(o, a);
}
template <class V> OS &operator<<(OS &o, unordered_set<V> const &a) {
  return outputContainer(o, a);
}
template <class K, class V> OS &operator<<(OS &o, map<K, V> const &a) {
  return outputContainer(o, a);
}
template <class V> OS &operator<<(OS &o, unordered_multiset<V> const &a) {
  return outputContainer(o, a);
}
template <class K, class V>
OS &operator<<(OS &o, unordered_map<K, V> const &a) {
  return outputContainer(o, a);
}

template <class Tuple, int I = tuple_size<Tuple>::value - 1> struct TupleHash {
  static size_t compute(size_t h, Tuple const &t) {
    auto v = get<I>(t);
    return TupleHash<Tuple, I - 1>::compute(h * 31 + hash<decltype(v)>{}(v), t);
  }
};
template <class Tuple> struct TupleHash<Tuple, -1> {
  static size_t compute(size_t h, Tuple const &tuple) { return h; }
};
namespace std {
template <typename... T> struct hash<tuple<T...>> {
  size_t operator()(tuple<T...> const &t) const {
    return TupleHash<tuple<T...>>::compute(17, t);
  }
};
} // namespace std

using lli = long long int;
lli gcd(lli const p, lli const q) { return q == 0 ? p : gcd(q, p % q); }
lli pow(lli const a, lli const n, lli const m) {
  return (!n) ? 1 : (n & 1) ? (((a % m) * pow(a, n - 1, m)) % m) : [=] {
    lli b = pow(a, n / 2, m);
    return (b * b) % m;
  }();
}
lli inv(lli const a, lli const p) { return pow(a, p - 2, p); }
constexpr lli MOD = 1e9 + 7;

#include <bitset>

int main() {
  int N;
  input(N);
  vector<int> a(N);
  input(a);
  string Yes = "Yes";
  string No = "No";
  /*
  vector<int> xor_sum(a.begin(), a.end());
  for (size_t i = 1; i < N; i++) {
    xor_sum[i] = xor_sum[i - 1] ^ a[i];
  }
  */
  auto x = a[0];
  auto y = a[1];
  unordered_multiset<int> a_set(a.begin(), a.end());
  // a_set.erase(x);
  // a_set.erase(y);
  vector<int> a_v(N);
  a_v[0] = x;
  a_v[1] = y;
  for (size_t j = 2; j < N; j++) {
    auto z = a_v[j - 1] ^ a_v[j - 2];
    if (a_set.find(z) == a_set.end())
      break;
    else {
      a_v[j] = z;
      // a_set.erase(z);
    }
  }
  vector<int> xxx(a_set.begin(), a_set.end());
  // print(xxx);
  sort(xxx.begin(), xxx.end());
  sort(a_v.begin(), a_v.end());
  for (int i = 0; i < N; ++i) {
    if (xxx[i] != a_v[i]) {
      print(No);
      return 0;
    }
  }
  print(Yes);

  // print(x, y, a_v, a_set);
}
