#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  scanf("%d", &N);
  if (N % 3 != 0) {
    for (int i = 0; i < N; i++) {
      int zero;
      scanf("%d", &zero);
      if (zero != 0) {
        printf("No");
        return 0;
      }
    }
    printf("Yes");
  } else {
    int vals[N];
    for (int i = 0; i < N; i++) {
      int val;
      scanf("%d", &val);
      vals[i] = val;
    }
    sort(vals, vals + N);
    int E = N / 3;
    int corevals[3];
    for (int i = 0; i < 3; i++) {
      if (vals[i * E] == vals[(i + 1) * E - 1]) {
        corevals[i] = vals[i * E];
      } else {
        printf("No");
        return 0;
      }
    }
    if (corevals[0] ^ corevals[E] == corevals[2 * E]) {
      printf("Yes");
      return 0;
    } else {
      printf("No");
    }
  }
}
