#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  cin >> N;
  map<long long, long long> cnt;
  for (long long i = 0; i < N; i++) {
    long long a;
    cin >> a;
    cnt[a]++;
  }
  vector<long long> v;
  for (map<long long, long long>::iterator it = cnt.begin(); it != cnt.end();
       it++) {
    v.push_back((*it).first);
  }
  if (v.size() == 1 && v[0] == 0) {
    cout << "Yes" << endl;
    return 0;
  }
  if (v.size() == 3 && (v[0] == (v[1] ^ v[2]))) {
    if (cnt[v[0]] == cnt[v[1]] && cnt[v[1]] == cnt[v[2]] &&
        cnt[v[0]] * 3 == N) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}
