#include <bits/stdc++.h>
using namespace std;
const int N = 100000 + 5;
int a[N], c[N], x[N];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  sort(a, a + n);
  int count = 0;
  for (int i = 0, j; i < n; i = j) {
    for (j = i; j < n && a[i] == a[j]; j++)
      ;
    c[count] = j - i;
    x[count] = a[i];
    count++;
  }
  if (count > 3 || count < 2) {
    puts("No");
    return 0;
  }
  if (count == 3) {
    if (c[0] == c[1] && c[1] == c[2] && (x[0] ^ x[1]) == x[2]) {
      puts("Yes");
    } else {
      puts("No");
    }
  } else {
    if (x[0] == 0 && c[1] == c[0] * 2) {
      puts("Yes");
    } else {
      puts("No");
    }
  }
  return 0;
}
