#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int a[N];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) scanf("%d", a + i);
  sort(a + 1, a + n + 1);
  if (a[n] == 0) {
    puts("Yes");
    return 0;
  } else if (n % 3) {
    puts("No");
    return 0;
  }
  int n1 = n / 3, n2 = n / 3 * 2;
  if (a[n1] == a[1] && a[n1 + 1] == a[n2] && a[n2 + 1] == a[n] &&
      (a[1] ^ a[n1 + 1] ^ a[n] == 0))
    puts("Yes");
  else
    puts("No");
  return 0;
}
