#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 c[3] = {1, 0, 0};
  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;
        c[j]++;
      }
    }
    if (judge == 1) {
      if (count >= 3) {
        printf("No\n");
        return 0;
      } else {
        kep[count] = a[i];
        c[count]++;
        count++;
      }
    }
  }
  for (int i = 0; i < (int)(3); i++) printf("###%d\n", kep[i]);
  for (int i = 0; i < (int)(3); i++) printf("###%d\n", c[i]);
  if (count == 1) {
    if (alz == 1)
      printf("Yes\n");
    else
      printf("No\n");
    return 0;
  }
  if (count == 2) {
    if (alz == 1)
      printf("Yes\n");
    else if (c[0] == c[1] * 2 && kep[1] == 0) {
      printf("Yes\n");
    } else if (c[1] == c[0] * 2 && kep[0] == 0) {
      printf("Yes\n");
    } else
      printf("No\n");
    return 0;
  }
  if (count == 3) {
    if (c[0] == c[1] && c[1] == c[2]) {
      if ((kep[0] ^ kep[2]) == kep[1])
        printf("Yes\n");
      else
        printf("No\n");
    } else
      printf("No\n");
    return 0;
  }
}
