#include <bits/stdc++.h>
using namespace std;
long long INFl = 1e+18 + 1;
int INF = 1e+9 + 1;
int main() {
  int N;
  map<int, int> kazu;
  vector<int> kind;
  cin >> N;
  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    if (kazu[a] == 0) {
      kind.push_back(a);
    }
    kazu[a]++;
  }
  sort(kind.begin(), kind.end());
  int flag = 0;
  if (N % 3 == 0) {
    if (kind.size() == 1 && kind[0] == 0) {
      flag = 1;
    } else if (kind.size() == 2) {
      if (kind[0] == 0 && kazu[0] == N / 3 && kazu[kind[1]] == 2 * N / 3)
        flag = 1;
    } else if (kind.size() == 3) {
      if (kazu[kind[0]] == N / 3 && kazu[kind[1]] == N / 3 &&
          kazu[kind[2]] == N / 3 && (kind[0] ^ kind[1] ^ kind[2]) == 0)
        flag = 1;
    }
  }
  if (flag)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
