#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  cin >> N;
  unordered_map<long long, long long> m;
  for (long long i = 0; i < N; i++) {
    long long a;
    cin >> a;
    m[a]++;
  }
  if (m.size() == 1)
    cout << "Yes" << endl;
  else {
    if ((N % 3 == 0) && (m.size() == 3)) {
      vector<long long> tmp;
      for (auto e : m) {
        if (e.second != N / 3) {
          cout << "No" << endl;
          return 0;
        }
        tmp.emplace_back(e.first);
      }
      if (tmp[0] ^ tmp[1] == tmp[2])
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    } else
      cout << "No" << endl;
  }
}
