#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  cin >> N;
  vector<long long> a(N);
  for (int(i) = 0; (i) < (N); ++(i)) {
    cin >> a[i];
  }
  bool isMake = true;
  long long kind = 0;
  map<long long, long long> countMap;
  for (int(i) = 0; (i) < (N); ++(i)) {
    if (countMap.find(a[i]) == countMap.end()) {
      countMap[a[i]] = 1;
      kind++;
    } else {
      countMap[a[i]]++;
    }
    if (kind >= 4) {
      isMake = false;
      break;
    }
  }
  if (isMake) {
    if (kind == 1) {
      if (countMap[0] != N) {
        isMake = false;
      }
    } else if (kind == 2) {
      if (N % 3 == 0) {
        if (countMap[0] != N / 3) {
          isMake = false;
        }
      }
      if (N % 3 == 1) {
        isMake = false;
      }
      if (N % 3 == 2) {
        if (countMap[0] != (N - 2) / 3 + 1) {
          isMake = false;
        }
      }
    } else if (kind == 3) {
      if (N % 3 != 0) {
        isMake = false;
      }
      vector<long long> numV;
      for (auto(it) = (countMap).begin(); (it) != (countMap).end(); ++(it)) {
        numV.push_back(it->first);
      }
      long long a = numV[0], b = numV[1], c = numV[2];
      if (!(countMap[a] == countMap[b] && countMap[a] == countMap[c])) {
        isMake = false;
      }
      if (!(a ^ b == c)) {
        isMake = false;
      }
    }
  }
  string ans = isMake ? "Yes" : "No";
  cout << ans << endl;
}
