#include <bits/stdc++.h>
int main() {
  const int kMaxNHat = 100000;
  int nHat;
  std::cin >> nHat;
  std::map<long long, int> num;
  int tmp;
  for (int iHat = 0; iHat < nHat; iHat++) {
    std::cin >> tmp;
    num[tmp]++;
  }
  bool isSuccessful;
  if (num.size() > 3) {
    isSuccessful = false;
  } else if (num.size() == 1) {
    auto itr = num.begin();
    if (!itr->first) {
      isSuccessful = true;
    } else {
      isSuccessful = false;
    }
  } else if (nHat % 3) {
    isSuccessful = false;
  } else if (num.size() == 2) {
    auto itr = num.begin();
    long long key1 = itr->first;
    itr++;
    long long key2 = itr->first;
    if (!key1 && 2 * num[key1] == num[key2]) {
      isSuccessful = true;
    } else if (!key2 && 2 * num[key2] == num[key1]) {
      isSuccessful = true;
    } else {
      isSuccessful = false;
    }
  } else {
    auto itr = num.begin();
    long long key[3];
    for (int iKey = 0; iKey < 3; iKey++) {
      key[iKey] = itr->first;
      itr++;
    }
    if ((num[key[0]] == num[key[1]]) && num[key[1]] == num[key[2]]) {
      if (key[0] ^ key[1] == key[2]) {
        isSuccessful = true;
      }
    } else {
      isSuccessful = false;
    }
  }
  std::cout << (isSuccessful ? "Yes" : "No") << std::endl;
}
