#include <bits/stdc++.h>
using si = std::int32_t;
using ui = std::uint32_t;
using ull = std::uint64_t;
si main() {
  ui n;
  std::cin >> n;
  std::vector<ull> an(n);
  for (auto& e : an) std::cin >> e;
  bool check = true;
  for (ui i{2}; i < n && check; ++i) {
    const auto t = an[i - 2] ^ an[i - 1];
    auto it = std::find(std::begin(an) + i, std::end(an), t);
    if (it == std::end(an))
      check = false;
    else
      std::swap(*it, an[i]);
  }
  check &= 0 == (an[0] ^ an[1] ^ an[n - 1]);
  check &= 0 == (an[0] ^ an[n - 1] ^ an[n - 2]);
  std::cout << (check ? "Yes" : "No") << "\n";
  return 0;
}
