#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll INF = (ll)1e18;
constexpr ll MOD = (ll)1e9 + 7;
constexpr double EPS = 1e-9;
constexpr ll dx[4] = {1LL, 0LL, -1LL, 0LL};
constexpr ll dy[4] = {0LL, 1LL, 0LL, -1LL};
constexpr ll dx8[8] = {1LL, 0LL, -1LL, 0LL, 1LL, 1LL, -1LL, -1LL};
constexpr ll dy8[8] = {0LL, 1LL, 0LL, -1LL, 1LL, -1LL, 1LL, -1LL};
void p() { std::cout << '\n'; }
template <typename Head, typename... Tail>
void p(Head head, Tail... tail) {
  std::cout << head << (sizeof...(tail) ? " " : "");
  p(tail...);
}
template <typename T>
inline void pv(std::vector<T>& v) {
  for (ll i = 0, N = v.size(); i < N; i++)
    std::cout << v[i] << " \n"[i == N - 1];
}
template <typename T>
inline T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <typename T>
inline T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <typename T>
inline bool chmax(T& a, T b) {
  return a < b && (a = b, true);
}
template <typename T>
inline bool chmin(T& a, T b) {
  return a > b && (a = b, true);
}
template <typename T>
inline void uniq(std::vector<T>& v) {
  v.erase(std::unique(v.begin(), v.end()), v.end());
}
void solve() {
  ll N;
  cin >> N;
  vector<ll> a(N);
  for (ll i = 0, i_length = (N); i < i_length; ++i) cin >> a[i];
  if ([&] {
        for (ll i = 0, i_length = (N); i < i_length; ++i)
          if (a[i]) return false;
        return true;
      }()) {
    p("Yes");
    return;
  }
  map<ll, ll> m;
  for (ll i = 0, i_length = (N); i < i_length; ++i) {
    m[a[i]]++;
  }
  if (N % 3 != 0) {
    p("No");
    return;
  }
  if (m.size() == 3) {
    vector<ll> v;
    for (auto pr : m) {
      if (pr.second != N / 3) {
        p("No");
        return;
      }
      v.push_back(pr.first);
    }
    if ((v[0] ^ v[1]) == v[2]) {
      p("Yes");
      return;
    }
    if ((v[1] ^ v[2]) == v[0]) {
      p("Yes");
      return;
    }
    if ((v[2] ^ v[0]) == v[1]) {
      p("Yes");
      return;
    }
    p("No");
    return;
  } else if (m.size() == 2) {
    if (m[0] != N / 3) {
      p("No");
      return;
    }
    for (auto pr : m) {
      if (pr.first == 0) continue;
      if (pr.second != 2 * N / 3) {
        p("No");
        return;
      }
    }
    p("Yes");
    return;
  }
}
signed main() {
  solve();
  return 0;
}
