#include <bits/stdc++.h>
using namespace std;
const int SIZE = 1 << 17;
int pointer = SIZE;
char buffer[SIZE];
char Advance() {
  if (pointer == SIZE) {
    fread(buffer, 1, SIZE, stdin);
    pointer = 0;
  }
  return buffer[pointer++];
}
int Read() {
  int answer = 0;
  char ch = Advance();
  while (!isdigit(ch)) ch = Advance();
  while (isdigit(ch)) {
    answer = answer * 10 + ch - '0';
    ch = Advance();
  }
  return answer;
}
int main() {
  int n, sum = 0;
  map<int, int> have;
  scanf("%d", &n);
  if (n % 3) {
    printf("No\n");
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    have[x]++;
  }
  for (auto &it : have) sum ^= it.first;
  if (have.size() > 3) {
    printf("No\n");
    return 0;
  }
  if (have.size() == 3) {
    bool bad = false;
    for (auto &it : have)
      if (it.second != n / 3) bad = true;
    if (bad || sum != 0)
      printf("No\n");
    else
      printf("Yes\n");
  } else if (have.size() == 2) {
    bool bad = false;
    for (auto &it : have)
      if ((it.first == 0 && it.second != n / 3) ||
          (it.first != 0 && it.second != 2 * n / 3))
        bad = true;
    if (bad)
      printf("No\n");
    else
      printf("Yes\n");
  } else if (sum == 0)
    printf("Yes\n");
  else
    printf("No\n");
  return 0;
}
