#include <bits/stdc++.h>
using namespace std;
int main(int argc, char **argv) {
  int i;
  size_t N;
  vector<size_t> A(3);
  vector<bool> founds(3, false);
  cin >> N;
  size_t a;
  size_t cnt = 0;
  string ans = "Yes";
  if (N % 3 != 0) ans = "No";
  for (int i = 0; i < N; i++) {
    cin >> a;
    for (size_t j = 0; j < 3; j++) {
      if (!founds[j]) {
        bool found = false;
        for (size_t k = 0; k < j; k++) {
          if (A[k] == a) found = true;
        }
        if (found) break;
        A[j] = a;
        founds[j] = true;
        cnt++;
        break;
      }
    }
    if (founds[0] && founds[1] && founds[2]) {
      if (A[0] != a && A[1] != a && A[2] != a) {
        ans = "No";
      }
    }
  }
  if (ans == "Yes") {
    if (cnt == 2) {
      if ((A[0] ^ A[0]) == A[1] && (A[1] ^ A[1]) == A[0]) {
        ans = "Yes";
      } else {
        ans = "No";
      }
    } else if (cnt == 3) {
      if ((A[0] ^ A[2]) != A[1]) {
        ans = "No";
      } else {
        ans = "Yes";
      }
    } else {
      ans = "No";
    }
  }
  cout << ans << endl;
  return 0;
}
