#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
inline long long read() {
  char ch = getchar();
  long long x = 0, f = 0;
  while (ch < '0' || ch > '9') f |= ch == '-', ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return f ? -x : x;
}
int n, a[maxn];
map<int, int> cnt;
int main() {
  n = read();
  if (n % 3) return puts("No"), 0;
  for (int i = (1); i <= (n); i++) a[i] = read(), cnt[a[i]]++;
  if (cnt[a[1]] == n / 3) {
    int x = 0, y = 0;
    for (map<int, int>::iterator it = cnt.begin(); it != cnt.end(); it++) {
      if (it->second != n / 3) return puts("No"), 0;
      if (it->first == a[1]) continue;
      if (!x)
        x = it->first;
      else
        y = it->first;
    }
    if ((x ^ y) == a[1])
      puts("Yes");
    else
      puts("No");
  } else if (cnt[a[1]] == n / 3 * 2) {
    if (cnt[0] == n / 3)
      puts("Yes");
    else
      puts("No");
  } else
    puts("No");
}
