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