#include <bits/stdc++.h>
int main() {
  int N;
  std::unordered_map<int, int> A;
  std::cin >> N;
  for (int i = 0; i < N; ++i) {
    int a;
    std::cin >> a;
    ++A[a];
  }
  if (N % 3 == 0) {
    if (A.size() != 3) {
      std::cout << "No\n";
    } else {
      auto it = A.begin();
      auto jt = it;
      ++jt;
      auto kt = jt;
      ++kt;
      if ((it->first ^ jt->first) == kt->first && it->second == jt->second &&
          jt->second && kt->second) {
        std::cout << "Yes\n";
      } else {
        std::cout << "No\n";
      }
    }
  } else {
    if (A.size() == 1 && A.begin()->first == 0) {
      std::cout << "Yes\n";
    } else {
      std::cout << "No\n";
    }
  }
}
