#include <bits/stdc++.h>
signed main() {
  long long n;
  std::cin >> n;
  std::vector<long long> a(n);
  for (long long i = 0; i < n; i++) std::cin >> a[i];
  std::sort(a.begin(), a.end());
  if (a[n - 1] == 0) {
    std::cout << ("Yes") << "\n";
    return 0;
  }
  if (n % 3) {
    std::cout << ("No") << "\n";
    return 0;
  }
  long long unique_count = 0;
  std::set<long long> temp(a.begin(), a.end());
  unique_count = temp.size();
  if (unique_count != 3) {
    std::cout << ("No") << "\n";
    return 0;
  }
  if ((*temp.begin() ^ *(std::next(temp.begin()))) !=
      *(std::next(std::next(temp.begin())))) {
    std::cout << ("No") << "\n";
    return 0;
  }
  std::map<long long, long long> count;
  for (long long i : a) {
    count[i]++;
  }
  long long ans = true;
  for (auto i : count) {
    if (i.second != n / 3) ans = false;
  }
  if (ans) {
    std::cout << ("Yes") << "\n";
    return 0;
  }
  std::cout << ("No") << "\n";
  return 0;
}
