#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long int N;
  cin >> N;
  set<long long int> v;
  for (int i = 0; i < N; i++) {
    long long int p;
    cin >> p;
    v.insert(p);
  }
  if (v.size() == 1 && *(v.begin()) == 0) {
    cout << "Yes" << endl;
  } else if (v.size() == 3 && N % 3 == 0) {
    vector<long long int> x;
    for (auto itr = v.begin(); itr != v.end(); itr++) {
      x.push_back(*itr);
    }
    if (((x[0] ^ x[1]) == x[2]) && ((x[1] ^ x[2]) == x[0]) &&
        ((x[2] ^ x[0]) == x[1])) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else {
    cout << "No" << endl;
  }
}
