#include <bits/stdc++.h>
constexpr int kMod = 1000000007;
int main() {
  int N;
  std::cin >> N;
  std::vector<int> a(N);
  std::map<int, int> as;
  for (int i = 0; i < N; ++i) {
    int a;
    std::cin >> a;
    ++as[a];
  }
  int num = as.size();
  if (num == 1 && as[0] == N) {
    std::cout << "Yes" << std::endl;
  } else if (N % 3 != 0) {
    std::cout << "No" << std::endl;
  } else if (num == 2 && as[0] == (N / 3)) {
    std::cout << "Yes" << std::endl;
  } else if (num == 3) {
    std::vector<int> keys;
    for (auto p : as) keys.push_back(p.first);
    if ((as[keys[0]] == as[keys[1]]) && (as[keys[1]] == as[keys[2]]) &&
        (keys[0] ^ keys[1] ^ keys[2] == 0)) {
      std::cout << "Yes" << std::endl;
    } else {
      std::cout << "No2" << std::endl;
    }
  } else {
    std::cout << "No" << std::endl;
  }
}
