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