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