#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int ret = 0;
  char c = getchar();
  while (c < 48 || c > 57) c = getchar();
  while (c >= 48 && c <= 57) ret = ret * 10 + c - 48, c = getchar();
  return ret;
}
int a[100090], ss, n, v[100090], u;
map<int, int> f;
int main() {
  n = read();
  for (int i = 1; i <= n; ++i) {
    a[i] = read();
    ++f[a[i]];
    if (f[a[i]] == 1) {
      v[++ss] = a[i];
    }
  }
  if (ss > 3) {
    puts("No");
    return 0;
  }
  if (ss == 1) {
    if (v[1] || n == 1) {
      puts("No");
      return 0;
    }
    puts("Yes");
    return 0;
  }
  sort(a + 1, a + n + 1);
  if (n % 3) {
    puts("No");
    return 0;
  }
  u = n / 3;
  for (int i = 1; i <= u; ++i) {
    if (a[i] ^ a[i + u] != a[i + u + u]) {
      puts("No");
      return 0;
    }
  }
  puts("Yes");
}
