#include <bits/stdc++.h>
using namespace std;
template <class T>
void read(T &res) {
  res = 0;
  T f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    res = res * 10 + c - '0';
    c = getchar();
  }
  res *= f;
}
template <class T>
void out(T x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x >= 10) out(x / 10);
  putchar('0' + x % 10);
}
int N;
int a[100005];
int num[3], cnt[3];
void Solve() {
  read(N);
  for (int i = 1; i <= N; ++i) {
    read(a[i]);
    if (!cnt[1] || num[1] == a[i]) {
      num[1] = a[i];
      ++cnt[1];
    } else if (!cnt[2] || num[2] == a[i]) {
      num[2] = a[i];
      ++cnt[2];
    } else if (!cnt[3] || num[3] == a[i]) {
      num[3] = a[i];
      ++cnt[3];
    } else {
      puts("No");
      return;
    }
  }
  if (cnt[1] == N && num[1] == 0) {
    puts("Yes");
    return;
  }
  if (N % 3) {
    puts("No");
    return;
  }
  int t = 0;
  for (int i = 1; i <= 3; ++i) {
    if (cnt[i] % (N / 3)) {
      puts("No");
      return;
    }
    if (cnt[i] == 2 * N / 3)
      t ^= 0;
    else
      t ^= num[i];
  }
  if (!t)
    puts("Yes");
  else
    puts("No");
}
int main() { Solve(); }
