#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  bool same = true;
  int a[n];
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    if (a[i] != a[0]) {
      same = false;
    }
  }
  if (a[0] == 0 && same) {
    printf("Yes\n");
    return 0;
  }
  if (n % 3 != 0) {
    printf("No\n");
    return 0;
  }
  sort(a, a + n);
  int b[3];
  for (int i = 0; i < 3; i++) {
    b[i] = a[n / 3 * i];
    for (int j = n / 3 * i; j < n / 3 * (i + 1); j++) {
      if (a[j] != b[i]) {
        printf("No\n");
        return 0;
      }
    }
  }
  if (b[0] ^ b[1] == b[2]) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }
}
