#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  cin >> N;
  string res = "No";
  vector<long long> a(100008, 0);
  vector<long long> acnt(100008, 0);
  bool zeroari = false;
  bool allzero = true;
  for (long long i = (0), iLen_ = (N); i < iLen_; i++) {
    cin >> a[i];
    acnt[a[i]]++;
    if (a[i] != 0) {
      allzero = false;
    } else {
      zeroari = true;
    }
  }
  if (allzero) {
    cout << "Yes" << endl;
    return 0;
  }
  if (N % 3 == 0) {
    long long Nb3 = N / 3;
    if (zeroari) {
      for (long long i = (0), iLen_ = (N); i < iLen_; i++) {
        if (a[i] != 0) {
          long long x = a[i];
          if (acnt[x] == 2 * Nb3 && acnt[0] == Nb3) {
            res = "Yes";
          }
          break;
        }
      }
    } else {
      for (long long i = (0), iLen_ = (N); i < iLen_; i++) {
        if (a[0] != a[i]) {
          long long x = a[0];
          long long y = a[i];
          long long z = x ^ y;
          if (acnt[x] == Nb3 && acnt[y] == Nb3 && acnt[z] == Nb3) {
            res = "Yes";
          }
          break;
        }
      }
    }
  }
  cout << res << endl;
}
