#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int N;
  std::cin >> N;
  multiset<int> pre;
  set<int> data;
  std::vector<int> a(N);
  for (int i = 0; i < N; i++) {
    std::cin >> a[i];
    if (pre.find(a[i]) == pre.end()) data.insert(a[i]);
    pre.insert(a[i]);
  }
  if (data.size() == 1) {
    if (*data.begin() == 0)
      std::cout << "Yes" << '\n';
    else
      std::cout << "No" << '\n';
  } else if (data.size() == 2) {
    auto ite = data.begin();
    int a = *ite;
    ite++;
    int b = *ite;
    if (a == 0 && pre.count(b) - pre.count(a) == 1)
      std::cout << "Yes" << '\n';
    else
      std::cout << "No" << '\n';
  } else if (data.size() == 3) {
    auto ite = data.begin();
    int a = *ite;
    ite++;
    int b = *ite;
    ite++;
    int c = *ite;
    int one = a ^ b;
    int two = a ^ c;
    int three = b ^ c;
    if (a != 0 && (one == c) && (two == b) && (three == a) &&
        pre.count(a) == pre.count(b) && pre.count(a) == pre.count(c))
      std::cout << "Yes" << '\n';
    else
      std::cout << "No" << '\n';
  } else
    std::cout << "No" << '\n';
  return 0;
}
