#include <bits/stdc++.h>
int main() {
  int i, N;
  long long a[100001];
  scanf("%d", &N);
  for (i = 1; i <= N; i++) scanf("%lld", &(a[i]));
  int j, type = 1, count[3] = {1, 0, 0};
  long long appear[3] = {a[1], -1, -1};
  for (i = 2; i <= N; i++) {
    for (j = 0; j < type; j++)
      if (a[i] == appear[j]) break;
    if (j < type)
      count[j]++;
    else if (type < 3) {
      count[type]++;
      appear[type++] = a[i];
    } else
      break;
  }
  if (i <= N)
    printf("No\n");
  else if (type == 1) {
    if (appear[0] == 0)
      printf("Yes\n");
    else
      printf("No\n");
  } else if (type == 2) {
    if ((appear[0] == 0 && count[0] * 2 == count[1]) ||
        (appear[1] == 0 && count[1] * 2 == count[0]))
      printf("Yes\n");
    else
      printf("No\n");
  } else {
    if (appear[0] ^ appear[1] == appear[2] && count[0] == count[1] &&
        count[1] == count[2])
      printf("Yes\n");
    else
      printf("No\n");
  }
  fflush(stdout);
  return 0;
}
