#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
int n;
long long a[maxn];
map<long long, int> cnt;
int tot, num[maxn];
long long rua[4];
inline long long read() {
  char c = getchar();
  long long x = 0, f = 1;
  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;
}
int main() {
  n = read();
  for (int i = 1; i <= n; i++) {
    a[i] = read();
    if (cnt[a[i]] == 0) {
      cnt[a[i]] = ++tot;
      if (tot > 3) return puts("No"), 0;
      rua[tot] = a[i];
    }
    num[cnt[a[i]]]++;
  }
  if (tot == 1 && rua[1] == 0)
    return puts("Yes"), 0;
  else if (tot == 1)
    return puts("No"), 0;
  if (n % 3 != 0) return puts("No"), 0;
  if (tot == 2) {
    if ((num[1] == 2 * num[2] && rua[2] == 0) ||
        (num[2] == num[1] * 2 && rua[1] == 0))
      return puts("Yes"), 0;
    else
      return puts("No"), 0;
  }
  if (tot != 3) return puts("No"), 0;
  if (num[1] != num[2] || num[2] != num[3]) return puts("No"), 0;
  if (rua[1] ^ rua[2] != rua[3]) return puts("No"), 0;
  puts("Yes");
  return 0;
}
