#include <bits/stdc++.h>
using namespace std;
int main() {
  int T = 1;
  while (T--) {
    int N;
    scanf("%d", &N);
    map<long long, int> cnt;
    for (int i = 1; i <= N; i++) {
      long long A;
      scanf("%lld", &A);
      cnt[A]++;
    }
    if (cnt.count(0) == N) {
      puts("Yes");
      continue;
    }
    if (N % 3 != 0 || cnt.size() > 3 || cnt.size() == 1) {
      puts("No");
      continue;
    }
    if (cnt.size() == 2) {
      puts(cnt[0] == N / 3 ? "Yes" : "No");
      continue;
    }
    int Sum = 0;
    bool Ans = 1;
    for (map<long long, int>::iterator it = cnt.begin(); it != cnt.end();
         it++) {
      Sum ^= it->first;
      if (it->second != N / 3) {
        Ans = 0;
        break;
      }
    }
    puts((Ans && !Sum) ? "Yes" : "No");
  }
}
