#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
int n, val[maxn];
int main() {
  scanf("%d", &n);
  int a = -1, na = 0, b = -1, nb = 0, c = -1, nc = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &val[i]);
    if (a == -1 || a == val[i])
      a = val[i], na++;
    else if (b == -1 || b == val[i])
      b = val[i], nb++;
    else if (c == -1 || c == val[i])
      c = val[i], nc++;
    else {
      puts("No");
      return 0;
    }
  }
  if (a == 0 && na == n) return puts("Yes"), 0;
  if (na == n / 2 && nb == n / 2 && (a == 0 || b == 0)) return puts("Yes"), 0;
  if (na == n / 3 && nb == n / 3 && nc == n / 3 && (a ^ b) == c)
    return puts("Yes"), 0;
  puts("No");
  return 0;
}
