#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  unordered_map<long long, long long> abcList;
  for (long long i = 0; i < n; i++) {
    long long tmp;
    cin >> tmp;
    abcList[tmp]++;
  }
  if (abcList.size() != 3) {
    cout << "No" << endl;
    return 0;
  } else {
    bool flag = true;
    auto itr = abcList.begin();
    long long num1 = itr->second;
    while (itr != abcList.end()) {
      if (num1 != itr->second) {
        flag = false;
        break;
      }
      itr++;
    }
    if (!flag) {
      cout << "No" << endl;
      return 0;
    } else {
      itr = abcList.begin();
      unsigned long long number1 = itr->first;
      itr++;
      unsigned long long number2 = itr->first;
      itr++;
      unsigned long long number3 = itr->first;
      if (number1 == (number2 ^ number3)) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    }
  }
}
