#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  int N;
  cin >> N;
  map<int, int> A;
  for (int i = (0); i < int(N); ++i) {
    int a;
    cin >> a;
    A[a]++;
  }
  if ((int)(A).size() > 3) {
    cout << "No" << endl;
    return 0;
  }
  vector<int> as;
  for (auto it : A) {
    as.push_back(it.first);
    if (N % it.second) {
      cout << "No" << endl;
      return 0;
    }
  }
  if (as[0] == 0) {
    if ((int)(as).size() == 1) {
      cout << "Yes" << endl;
      return 0;
    } else if ((int)(as).size() == 2 && A[0] * 3 == N) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  if ((int)(as).size() != 3) {
    cout << "No" << endl;
    return 0;
  }
  if ((as[0] ^ as[1] ^ as[2]) == 0) {
    cout << "Yes" << endl;
    return 0;
  }
  cout << "No" << endl;
  return 0;
}
