#include <bits/stdc++.h>
int main() {
  int n, a, b, c, o, p, q, i, x;
  scanf("%d", &n);
  if (n % 3 != 0) {
    for (i = 0; i < n; i++)
      if (scanf("%d", &x), x != 0) return puts("No"), 0;
    puts("Yes");
    return 0;
  }
  a = b = c = -1, o = p = q = 0;
  for (i = 0; i < n; i++) {
    scanf("%d", &x);
    if (a == -1)
      a = x, o = 1;
    else if (a == x)
      o++;
    else if (b == -1)
      b = x, p = 1;
    else if (b == x)
      p++;
    else if (c == -1)
      c = x, q = 1;
    else if (c == x)
      q++;
    else
      return puts("No"), 0;
  }
  puts(o == p && p == q && (a ^ b) == c ||
               c == -1 && (p == q * 2 && b == 0 || q == p * 2 && a == 0) ||
               b == -1 && a == 0
           ? "Yes"
           : "No");
}
