#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  set<int> K;
  vector<int>(C);
  ;
  for (int x = 0; x < (N); x++) {
    int a;
    cin >> a;
    K.insert(a);
    (C).push_back((a));
    ;
  }
  if (K.size() == 1) {
    if (C[0] == 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else if (N % 3 != 0) {
    cout << "No" << endl;
  } else if (K.size() != 3) {
    cout << "No" << endl;
  } else if (N == 3) {
    if ((C[0] ^ C[2]) == C[1] && (C[1] ^ C[0]) == C[2] &&
        (C[2] ^ C[1]) == C[0]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else {
    cout << "Yes" << endl;
  }
  return 0;
}
