#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long i, temp;
  unordered_map<long long, long long> b;
  for (i = 0; i < n; i++) {
    cin >> temp;
    b[temp]++;
  }
  if (b.size() != 3)
    cout << "No" << endl;
  else {
    unordered_map<long long, long long>::iterator it1 = b.begin();
    unordered_map<long long, long long>::iterator it2 = it1++;
    unordered_map<long long, long long>::iterator it3 = it2++;
    if (it1->second == it2->second && it2->second == it3->second) {
      if (it1->first ^ it2->first == it3->first)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    } else
      cout << "No" << endl;
  }
}
