#include <bits/stdc++.h>
using namespace std;
void getint(int &v) {
  char ch, fu = 0;
  for (ch = '*'; (ch < '0' || ch > '9') && ch != '-'; ch = getchar())
    ;
  if (ch == '-') fu = 1, ch = getchar();
  for (v = 0; ch >= '0' && ch <= '9'; ch = getchar()) v = v * 10 + ch - '0';
  if (fu) v = -v;
}
int n, a[500010], l, r, m, b[500010];
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) getint(a[i]);
  sort(a + 1, a + n + 1);
  l = 1;
  r = n;
  for (int i = 1; i <= n / 2; ++i) b[++m] = a[l++], b[++m] = a[r--];
  if (n & 1) b[++m] = a[l++];
  for (int i = 2; i <= m - 1; ++i)
    if (b[i] != b[i - 1] ^ b[i + 1]) return puts("No"), 0;
  if (b[1] != b[2] ^ b[m]) return puts("No"), 0;
  if (b[m] != b[m - 1] ^ b[1]) return puts("No"), 0;
  puts("Yes");
  return 0;
}
