#include <bits/stdc++.h>
int n, a[300100];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  std::sort(a + 1, a + n + 1);
  if (n % 3 != 0) return puts("No"), 0;
  if (a[1] != a[n / 3] || a[n / 3 + 1] != a[n / 3 * 2] ||
      a[n / 3 * 2 + 1] != a[n])
    return puts("No"), 0;
  if ((a[n / 3] ^ a[n / 3 * 2] ^ a[n]) != 0) return puts("No"), 0;
  puts("Yes");
}
