#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  char c = getchar();
  long long f = 1, x = 0;
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = x * 10 + (c - '0'), c = getchar();
  return x * f;
}
void MOD(int &x) {
  if (x >= 1000000007) x -= 1000000007;
}
int b[100010], a[100010];
int main() {
  int n;
  n = read();
  for (int i = 1; i <= n; i++) {
    a[i] = read();
  }
  sort(a + 1, a + n + 1);
  int cnt = 0;
  a[0] = -1;
  for (int i = 1; i <= n; i++)
    if (a[i] != a[i - 1]) {
      b[++cnt] = a[i];
    }
  if (cnt > 3)
    puts("No");
  else {
    if (n % 3 == 0) {
      if (cnt == 3) {
        if ((b[1] ^ b[2]) == b[3] || (b[2] ^ b[3]) == b[1] ||
            (b[3] ^ b[1]) == b[2])
          puts("Yes");
        else
          puts("No");
      }
      if (cnt == 2) {
        if ((b[1] ^ b[2]) == b[1] || (b[2] ^ b[1]) == b[2] ||
            (b[1] ^ b[1]) == b[2] || (b[2] ^ b[2]) == b[1])
          puts("Yes");
        else
          puts("No");
      }
      if (cnt == 1) {
        if ((b[1] ^ b[1]) == b[1])
          puts("Yes");
        else
          puts("No");
      }
    } else if (cnt <= 1 && (b[1] ^ b[1]) == b[1])
      puts("Yes");
    else
      puts("No");
  }
}
