#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; ++i) check &= (an[i] ^ an[i - 1]) == an[i - 2];
  check &= (an[0] ^ an[1]) == an[n - 1];
  check &= an[0] == (an[n - 1] ^ an[n - 2]);
  std::cout << (check ? "Yes" : "No") << "\n";
  return 0;
}
