#include <bits/stdc++.h>
using namespace std;
int n, a[100000 + 5], s[100000 + 5];
class FastIO {
 private:
  char c, *A, *B, FI[100000];

 public:
  inline FastIO() { A = B = FI; }
  template <typename Ty>
  inline void read(Ty& x) {
    x = 0;
    while (!isdigit(
        c = (A == B && (B = (A = FI) + fread(FI, 1, 100000, stdin), A == B)
                 ? EOF
                 : *A++)))
      ;
    while (x = (x << 3) + (x << 1) + (c & 15),
           isdigit(c = (A == B && (B = (A = FI) + fread(FI, 1, 100000, stdin),
                                   A == B)
                            ? EOF
                            : *A++)))
      ;
  }
  template <typename Ty, typename... Ar>
  inline void read(Ty& x, Ar&... y) {
    read(x), read(y...);
  }
} F;
int main() {
  register int i, t = 0;
  for (F.read(n), i = 1; i <= n; ++i) F.read(a[i]);
  for (sort(a + 1, a + n + 1), i = 1; i <= n; ++i) s[i] = a[i];
  t = unique(s + 1, s + n + 1) - s - 1;
  if (n % 3) return puts("No"), 0;
  for (i = 1; i < n / 3; ++i)
    if (a[i] ^ a[i + 1]) return puts("No"), 0;
  for (i = n / 3 + 1; i < n / 3 * 2; ++i)
    if (a[i] ^ a[i + 1]) return puts("No"), 0;
  for (i = n / 3 * 2 + 1; i < n; ++i)
    if (a[i] ^ a[i + 1]) return puts("No"), 0;
  return puts(t <= 3 && (a[1] ^ a[n / 3 + 1]) == a[n] ? "Yes" : "No"), 0;
}
