#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  map<int, int> cnt;
  for (int i = 0; i < (N); ++i) {
    cin >> A[i];
    cnt[A[i]]++;
  }
  if (cnt[0] == N) {
    puts("Yes");
    return 0;
  }
  if (N % 3 != 0) {
    puts("No");
    return 0;
  }
  vector<int> all;
  for (auto p : cnt) {
    for (int i = 0; i < p.second / (N / 3); i++) {
      all.push_back(p.first);
    }
  }
  if (all.size() == 3 && all[0] ^ all[1] ^ all[2] == 0)
    puts("Yes");
  else
    puts("No");
  return 0;
}
