#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  long long a[100005] = {};
  int alz = 1;
  int kep[3] = {-1, -1, -1};
  int count = 1;
  for (int i = 0; i < (int)(n); i++) {
    scanf("%lld", &a[i]);
    if (a[i] != 0) alz = 0;
  }
  if (n % 3 == 1 || n % 3 == 2) {
    if (alz == 1)
      printf("Yes\n");
    else
      printf("No\n");
    return 0;
  }
  kep[0] = a[0];
  for (int i = 1; i < n; i++) {
    int judge = 1;
    for (int j = 0; j < (int)(count); j++) {
      if (kep[j] == a[i]) {
        judge = 0;
      }
    }
    if (judge == 1) {
      if (count >= 3) {
        printf("%d\n", count);
        printf("No\n");
        return 0;
      } else {
        kep[count] = a[i];
        count++;
      }
    }
  }
  if ((kep[0] ^ kep[2]) == kep[1])
    printf("Yes\n");
  else
    printf("No\n");
  return 0;
}
