#include <bits/stdc++.h>
const int N = 100005;
int n, a[N];
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) {
    puts("No");
    return 0;
  }
  if (a[1] != a[n / 3] || a[n / 3 + 1] != a[n / 3 * 2] ||
      a[n / 3 * 2 + 1] != a[n]) {
    puts("No");
    return 0;
  }
  if (a[1] ^ a[n / 3 + 1] ^ a[n] == 0)
    puts("Yes");
  else
    puts("No");
  return 0;
}
