#include <bits/stdc++.h>
using namespace std;
const int mx = 100005;
int n, m, a[mx];
bool ans = true;
int main() {
  scanf("%d", &n);
  if (n % 3) ans = false;
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  sort(a, a + n);
  for (int i = 0; i < n - 1; i++)
    if (i != n / 3 - 1 && i != n / 3 * 2 - 1 && a[i] != a[i + 1]) ans = false;
  if ((a[0] ^ a[n / 3]) != a[n / 3 * 2]) ans = false;
  puts(ans ? "Yes" : "No");
}
