#include <bits/stdc++.h>
using namespace std;
long long A[800000 + 5];
map<long long, int> cnt;
int main() {
  int T = 1;
  while (T--) {
    int N;
    scanf("%d", &N);
    bool Same = 1, Zero = 0;
    long long Sum = 0;
    for (int i = 1; i <= N; i++) {
      scanf("%lld", A + i);
      cnt[A[i]]++;
    }
    if (cnt[0] == N) {
      puts("Yes");
      continue;
    }
    if (N % 3 != 0) {
      puts("No");
      continue;
    }
    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");
  }
}
