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