#include <bits/stdc++.h>
using namespace std;
template <class T>
using VV = vector<vector<T>>;
template <class T>
inline T SMIN(T& a, const T b) {
  return a = (a > b) ? b : a;
}
template <class T>
inline T SMAX(T& a, const T b) {
  return a = (a < b) ? b : a;
}
template <class Iter>
void __kumaerrc(Iter begin, Iter end) {
  for (; begin != end; ++begin) {
    cerr << *begin << ',';
  }
  cerr << endl;
}
void __kumaerr(istream_iterator<string> it) {
  (void)it;
  cerr << endl;
}
template <typename T, typename... Args>
void __kumaerr(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << "=" << a << ", ", __kumaerr(++it, args...);
}
template <typename S, typename T>
std::ostream& operator<<(std::ostream& _os, const std::pair<S, T>& _p) {
  return _os << "{" << _p.first << ',' << _p.second << "}";
}
const int MAX_N = 1e6 + 1;
long long A[MAX_N];
int N;
bool solve() {
  if (N == 3) {
    return (A[0] ^ A[1]) == A[2];
  }
  for (int i = 0; i < (N); ++i)
    if (A[i] != 0) return false;
  return true;
}
void rem(int x, map<int, int>& cnt) {
  cnt[x]--;
  if (cnt[x] == 0) cnt.erase(x);
}
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
int genRandNum(int lb, int ub) {
  assert(lb < ub);
  int x = rnd() % (int)(ub - lb);
  return x + lb;
}
vector<int> genRandSeq(int size, int lb, int ub) {
  if (size == 0) return {};
  vector<int> res(size);
  generate(res.begin(), res.end(), [&]() { return genRandNum(lb, ub); });
  return res;
}
void test() {
  N = 7;
  vector<int> B = genRandSeq(N, 0, 5);
  for (int i = 0; i < (N); ++i) A[i] = B[i];
  bool act = solve();
  bool exp = false;
  sort((B).begin(), (B).end());
  do {
    bool res = true;
    for (int i = 0; i < (N); ++i)
      res &= (A[i] ^ A[(i + 1) % N]) == A[(i + 2) % N];
    exp |= res;
  } while (next_permutation((B).begin(), (B).end()));
  if (exp) {
    cerr << "B"
         << ": ";
    for (auto& x : (B)) {
      cerr << x << ',';
    }
    cerr << endl;
  };
  if (act != exp) {
    cerr << "B"
         << ": ";
    for (auto& x : (B)) {
      cerr << x << ',';
    }
    cerr << endl;
  };
  assert(act == exp);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << setprecision(12) << fixed;
  cin >> N;
  for (int i = 0; i < (N); ++i) cin >> A[i];
  cout << (solve() ? "Yes" : "No") << endl;
  return 0;
}
