#include <bits/stdc++.h>
using namespace std;
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long a;
  map<long long, long long> m;
  for (long long i = 0; i < (n); i++) {
    cin >> a;
    if (m.find(a) == m.end())
      m[a] = 1;
    else
      m[a]++;
  }
  if (m.size() != 3)
    cout << "No" << endl;
  else {
    long long data[3];
    long long pair<long long, long long> = 0;
    long long tmp = m.begin()->second;
    for (auto it = m.begin(); it != m.end(); it++) {
      if (it->second != tmp) {
        cout << "No" << endl;
        return 0;
      }
      data[pair<long long, long long>] = it->first;
      pair<long long, long long> ++;
    }
    if (data[0] != (data[1] ^ data[2])) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  }
}
