#include <bits/stdc++.h>
using namespace std;
const long long N = 100011;
const long long INF = 5e16;
namespace IO {
inline char gc() {
  static char buf[100000], *p1 = buf, *p2 = buf;
  return (p1 == p2) &&
                 (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
inline long long read() {
  register long long x = 0;
  register int f = 0;
  register char ch = getchar();
  for (; !isdigit(ch); ch = getchar()) f ^= (ch == '-');
  for (; isdigit(ch); ch = getchar()) x = x * 10 + (ch ^ 48);
  return f ? -x : x;
}
inline void write(long long x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) write(x / 10);
  putchar(x % 10 | 48);
}
inline void wrn(long long x) {
  write(x);
  putchar(' ');
}
inline void wln(long long x) {
  write(x);
  putchar('\n');
}
inline void wlnn(long long x, long long y) { wrn(x), wln(y); }
}  // namespace IO
using IO::read;
using IO::wln;
namespace Cesare {
long long n, a[N];
int main() {
  n = read();
  for (register int i = (1), ED = (n); i <= ED; ++i) a[i] = read();
  sort(a + 1, a + n + 1);
  if ((a[n] ^ a[2]) != a[1]) return puts("No"), 0;
  if ((a[1] ^ a[n - 1]) != a[n]) return puts("No"), 0;
  for (register int i = (2), ED = (n - 1); i <= ED; ++i)
    if ((a[i - 1] ^ a[i + 1]) != a[i]) return puts("No"), 0;
  return puts("Yes"), 0;
}
}  // namespace Cesare
int main() { return Cesare::main(); }
