#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
int main(int argc, char const *argv[]) {
  int n;
  std::cin >> n;
  std::map<int, int> m;
  for (size_t i = 0; i < n; i++) {
    int tmp;
    std::cin >> tmp;
    if (m[tmp] == 0) {
      m[tmp] = 1;
    } else {
      m[tmp]++;
    }
  }
  if (m.size() == 1) {
    auto itr = m.begin();
    if (itr->first == 0) {
      std::cout << "Yes" << '\n';
      return 0;
    } else {
      std::cout << "No" << '\n';
      return 0;
    }
  }
  if (m.size() == 2) {
    auto itr = m.begin();
    if (itr->first == 0) {
      if (itr->second == n / 3) {
        std::cout << "Yes" << '\n';
        return 0;
      }
    }
    itr++;
    if (itr->first == 0) {
      if (itr->second == n / 3) {
        std::cout << "Yes" << '\n';
        return 0;
      }
    }
    std::cout << "No" << '\n';
    return 0;
  }
  if (m.size() > 3) {
    std::cout << "No" << '\n';
    return 0;
  }
  int xyz[3];
  int i = 0;
  for (auto itr = m.begin(); itr != m.end(); itr++) {
    xyz[i] = itr->first;
    i++;
    if (!(itr->second == n / 3 || itr->second == n / 3 + 1)) {
      std::cout << "No" << '\n';
      return 0;
    }
  }
  if (xyz[0] ^ xyz[1] != xyz[2]) {
    std::cout << "No" << '\n';
    return 0;
  }
  std::cout << "Yes" << '\n';
  return 0;
}
