#include <bits/stdc++.h>
int compare_int(const void *a, const void *b) { return *(int *)a - *(int *)b; }
int main() {
  int n;
  scanf("%d", &n);
  int a[n];
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  int value[3];
  int value_count[3] = {0, 0, 0};
  int flag = 0;
  int notzero_count = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] != 0) {
      notzero_count++;
    }
  }
  if (notzero_count == 0) {
    printf("Yes\n");
    return 0;
  } else {
    if (n % 3 != 0) {
      printf("No\n");
      return 0;
    }
  }
  qsort(a, n, sizeof(a[0]), compare_int);
  int setflag = 0;
  for (int i = 0; i < n - 2 && setflag == 0; i++) {
    for (int j = i + 1; j < n - 1 && setflag == 0; j++) {
      for (int k = j + 1; k < n && setflag == 0; k++) {
        if (a[i] != a[j] && a[i] != a[k] && a[j] != a[k]) {
          value[0] = a[i];
          value[1] = a[j];
          value[2] = a[k];
          setflag = 1;
          break;
        }
        if (a[j] != a[k]) {
          j = k;
        }
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (a[i] != value[0] && a[i] != value[1] && a[i] != value[2]) {
      printf("No\n");
      return 0;
    } else if (a[i] == value[0]) {
      value_count[0]++;
    } else if (a[i] == value[1]) {
      value_count[1]++;
    } else {
      value_count[2]++;
    }
  }
  if (value_count[0] == value_count[1] && value_count[0] == value_count[2]) {
    if (value_count[0] * 3 == n && value[0] == value[1] ^ value[2]) {
      flag = 1;
    }
  }
  if (flag == 1) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }
  return 0;
}
