#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  map<long long, int> m;
  long long a;
  bool all_zero = true;
  for (int i = 0; i < N; i++) {
    cin >> a;
    if (a != 0) {
      all_zero = false;
    }
    m[a]++;
  }
  if (all_zero) {
    cout << "Yes" << endl;
    return 0;
  }
  if ((m.size() < 3) || (m.size() > 3)) {
    cout << "No" << endl;
    return 0;
  }
  vector<long long> x;
  vector<long long> n;
  for (auto itr = m.begin(); itr != m.end(); itr++) {
    x.push_back(itr->first);
    n.push_back(itr->second);
  }
  if ((n[0] != n[1]) || (n[1] != n[2])) {
    cout << "No" << endl;
    return 0;
  }
  if (((x[0] ^ x[1]) == x[2]) && ((x[1] ^ x[2]) == x[0]) &&
      ((x[2] ^ x[0]) == x[1])) {
    cout << "Yes" << endl;
    return 0;
  }
  cout << "No" << endl;
}
