#include <bits/stdc++.h>
namespace tools {
template <typename T>
void read(std::vector<T>& vector,
          const typename std::vector<T>::size_type size) {
  vector.reserve(size);
  std::copy_n(std::istream_iterator<T>(std::cin), size,
              std::back_inserter(vector));
}
template <typename T, std::size_t N>
void read(std::array<T, N>& array) {
  std::copy_n(std::istream_iterator<T>(std::cin), N, array.begin());
}
}  // namespace tools
int main() {
  std::int_fast64_t N;
  std::cin >> N;
  std::vector<std::uint_fast64_t> a;
  tools::read(a, N);
  if (std::all_of(a.begin(), a.end(),
                  [](const std::uint_fast64_t a_i) { return a_i == 0; })) {
    std::cout << "Yes" << std::endl;
  } else if (N % 3 != 0) {
    std::cout << "No" << std::endl;
  } else {
    std::unordered_map<std::uint_fast64_t, std::uint_fast64_t> map;
    for (const std::uint_fast64_t& a_i : a) {
      map.insert(std::make_pair(a_i, 0));
      ++map[a_i];
    }
    if (map.size() != 3) {
      std::cout << "No" << std::endl;
    } else {
      std::unordered_set<std::uint_fast64_t> set;
      for (const std::pair<std::uint_fast64_t, std::uint_fast64_t>& pair :
           map) {
        set.insert(pair.second);
      }
      if (set.size() != 1) {
        std::cout << "No" << std::endl;
      } else {
        std::vector<std::uint_fast64_t> vector;
        for (const std::pair<std::uint_fast64_t, std::uint_fast64_t>& pair :
             map) {
          vector.push_back(pair.first);
        }
        if ((vector[0] ^ vector[1]) == vector[2]) {
          std::cout << "Yes" << std::endl;
        } else {
          std::cout << "No" << std::endl;
        }
      }
    }
  }
  return 0;
}
