#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void read(T &x) {
  int f = 1;
  char k = getchar();
  x = 0;
  for (; k > '9' || k < '0'; k = getchar())
    if (k == '-') f = -1;
  for (; k >= '0' && k <= '9'; k = getchar()) x = (x << 3) + (x << 1) + k - '0';
  x *= f;
}
long long n, k, val[4], tot[4], cnt;
map<long long, bool> mp;
bool fla;
bool check() {
  if (n % 3 != 0) return (cnt == 1) && (val[1] == 0);
  if (cnt == 1) return (val[1] == 0);
  if (cnt == 2) {
    if (val[1] == 0)
      return (tot[1] == n / 3);
    else if (val[2] == 0)
      return (tot[2] == n / 3);
    else
      return false;
  }
  if (cnt == 3)
    return (tot[1] == tot[2]) && (tot[1] == tot[3]) &&
           ((val[1] ^ val[2]) == val[3]);
}
int main() {
  read(n);
  for (register int i = 1; i <= n; ++i) {
    read(k);
    if (!mp[k]) {
      if (cnt == 3)
        fla = 1;
      else
        val[++cnt] = k, mp[k] = 1;
    } else {
      for (register int j = 1; j <= cnt; ++j)
        if (val[j] == k) tot[j]++;
    }
  }
  if (!fla && check())
    printf("Yes");
  else
    printf("No");
  return 0;
}
