#include <bits/stdc++.h>
using namespace std;
int readint() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int n, tot;
int a[100005], p[100005];
int main() {
  n = readint();
  for (int i = 1; i <= n; i++) p[i] = a[i] = readint();
  sort(p + 1, p + n + 1);
  tot = unique(p + 1, p + n + 1) - p - 1;
  if (tot > 3) return printf("No\n"), 0;
  if (tot == 1 && p[1] == 0) return printf("Yes\n"), 0;
  if (n % 3 != 0) return printf("No\n"), 0;
  if (tot == 2) {
    if (p[1] != 0) return printf("No\n"), 0;
    int cnt = 0;
    for (int i = 1; i <= n; i++)
      if (a[i] == p[1]) cnt++;
    if (cnt == n / 3)
      return printf("Yes\n"), 0;
    else
      return printf("No\n"), 0;
  }
  int cnt1 = 0, cnt2 = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] == p[1])
      cnt1++;
    else if (a[i] == p[2])
      cnt2++;
  }
  if (cnt1 != cnt2 || cnt1 != n / 3) return printf("No\n"), 0;
  if ((p[1] ^ p[2]) == p[3] && (p[2] ^ p[3]) == p[1]) return printf("Yes\n"), 0;
  return 0;
}
