#include <bits/stdc++.h>
using namespace std;
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long N;
  cin >> N;
  vector<long long> A(N);
  bool F = true;
  long long cnt = 0;
  map<long long, long long> mp;
  vector<long long> B;
  for (long long i = 0; i < N; i++) {
    cin >> A[i];
    if (N % 3 != 0 && A[i] != 0) {
      F = false;
    }
    if (mp[A[i]] == 0) {
      cnt++;
      B.push_back(A[i]);
    }
    mp[A[i]]++;
  }
  if (N % 3 == 0) {
    if (cnt > 3) {
      F = false;
    }
    for (long long i = 0; i < B.size(); i++) {
      if (mp[B[i]] != (N / 3)) {
        F = false;
        cout << "K" << endl;
      }
    }
    if (B[0] ^ B[1] != B[2] && B[0] ^ B[2] != B[1] && B[1] ^ B[2] != B[0]) {
      F = false;
    }
  }
  if (F) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
