#include <bits/stdc++.h>
int main() {
  int N;
  int an;
  int a[3];
  int num;
  int anum[3];
  bool byes = true;
  num = 0;
  for (int i = 0; i < 3; i++) {
    a[i] = -1;
    anum[i] = 0;
  }
  scanf("%d", &N);
  for (int j = 0; j < N; j++) {
    scanf("%d", &an);
    if (num == 0) {
      num++;
      a[0] = an;
      anum[0] += 1;
    } else if (num < 3) {
      for (int i = 0; i < num; i++) {
        if (a[i] == an) {
          anum[i] += 1;
          break;
        } else if (i == num - 1) {
          a[num] = an;
          anum[num] += 1;
          num++;
          break;
        }
      }
    } else {
      for (int i = 0; i < 3; i++) {
        if (a[i] == an) {
          anum[i]++;
          break;
        } else if (i == 2 && byes) {
          byes = !byes;
        }
      }
    }
  }
  int aaa = a[0] ^ a[1] ^ a[2];
  if (byes && ((N % 3 != 0) || (num != 3) || (anum[0] != anum[1]) ||
               (anum[0] != anum[2]) || (aaa != 0))) {
    byes = !byes;
  }
  if (num == 1 && a[0] == 0) {
    byes = !byes;
  }
  if (byes) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }
  return 0;
}
