#include <bits/stdc++.h>
using namespace std;
long long A[800000 + 5];
int main() {
  int N;
  scanf("%d", &N);
  map<long long, int> cnt;
  for (int i = 1; i <= N; i++) {
    scanf("%lld", A + i);
    cnt[A[i]]++;
  }
  if (cnt[0] == N) {
    puts("Yes");
    return 0;
  }
  if (N % 3 != 0) {
    puts("No");
    return 0;
  }
  int Group = N / 3;
  vector<int> tmp;
  for (map<long long, int>::iterator it = cnt.begin(); it != cnt.end(); ++it) {
    for (int i = 1; i <= it->second / Group; i++) tmp.push_back(it->first);
  }
  if (tmp.size() == 3 && tmp[0] ^ tmp[1] ^ tmp[2] == 0)
    puts("Yes");
  else
    puts("No");
}
