#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 100;
int n, a[maxn], b[maxn], m;
map<int, int> mps;
bool check() {
  if (n % 3) {
    for (int i = 0; i < n; ++i)
      if (a[i]) return false;
    return true;
  }
  for (int i = 0; i < n; ++i) {
    if (!mps[a[i]]) b[m++] = a[i];
    mps[a[i]]++;
  }
  if (m >= 4) return false;
  if (m == 1)
    return b[0] == 0;
  else if (m == 2)
    return mps[0] == n / 3;
  else
    return mps[b[0]] == mps[b[1]] && mps[b[1]] == mps[b[2]] &&
           b[0] ^ b[1] == b[2];
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", &a[i]);
  if (check())
    printf("Yes\n");
  else
    printf("No\n");
}
