#include <bits/stdc++.h>
long XOR(long a1, long a2) {
  int a1_keta[31], a2_keta[31], out_keta[31];
  int i = 0;
  long out = 0;
  long dummy_a1 = 0;
  long dummy_a2 = 0;
  dummy_a1 = a1;
  dummy_a2 = a2;
  for (i = 30; i > -1; i--) {
    a1_keta[i] = 0;
    if (a1 >= (long)pow(2.0, (double)i)) {
      a1 -= (long)pow(2.0, (double)i);
      a1_keta[i] = 1;
    }
    a2_keta[i] = 0;
    if (a2 >= (long)pow(2.0, (double)i)) {
      a2 -= (long)pow(2.0, (double)i);
      a2_keta[i] = 1;
    }
    out_keta[i] = 0;
    out_keta[i] = (a1_keta[i] + a2_keta[i]) % 2;
    out += pow(2.0, (double)i) * out_keta[i];
  }
  return out;
}
int main(int argc, char const *argv[]) {
  long a[100000];
  int counter = 0;
  int N;
  scanf("%d", &N);
  int i = 0;
  long dummy = 0;
  for (i = 0; i < N; i++) {
    dummy = 0;
    scanf("%ld", &dummy);
    if (N > 3 && dummy > 0) {
      counter = 1;
    }
    a[i] = dummy;
  }
  if (N == 3 && counter == 0) {
    double judge = abs(XOR(a[0], a[1]) - a[2]) + abs(XOR(a[1], a[2]) - a[0]) +
                   abs(XOR(a[0], a[2]) - a[1]);
    counter += (int)judge;
  }
  if (counter < 0.1) {
    printf("Yes");
  } else if (counter > 0.05) {
    printf("No");
  }
  return 0;
}
