#include <bits/stdc++.h>
using namespace std;
int n;
int a[100500];
bool jud() {
  if ((a[1] ^ a[2]) == a[3]) return 1;
  if ((a[2] ^ a[3]) == a[1]) return 1;
  if ((a[1] ^ a[3]) == a[2]) return 1;
  return 0;
}
bool jud2() {
  int c = 0, d = 0;
  for (int i = 1; i <= n; i++)
    if (a[i] == 0) c++;
  for (int i = 1; i <= n; i++)
    if (a[i]) d++;
  if (d == c * 2) return 1;
  return 0;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  sort(a + 1, a + 1 + n);
  int cnt = unique(a + 1, a + 1 + n) - a - 1;
  if (cnt == 1 && a[1] == 0)
    puts("Yes");
  else if (cnt == 2 && jud2())
    puts("Yes");
  else if (cnt == 3 && jud() && n % 3 == 0)
    puts("Yes");
  else
    puts("No");
  return 0;
}
