#include <bits/stdc++.h>
int main(void) {
  int n;
  int a, b, c, first, sec;
  int i;
  scanf("%d\n", &n);
  int flag = 1;
  scanf("%d %d ", &a, &b);
  first = a;
  sec = b;
  for (i = 1; i < n; i++) {
    if (i == n - 1) {
      scanf("%d\n", &c);
      if (c != (int)(a ^ first)) flag = 0;
    } else {
      scanf("%d ", &c);
      if (b != (int)(a ^ c)) flag = 0;
      a = b;
      b = c;
    }
  }
  if (first != (int)(c ^ sec)) flag = 0;
  if (flag)
    printf("Yes");
  else
    printf("No");
  return 0;
}
