#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 10;
map<int, int> ss;
int n, x;
int main() {
  scanf("%d", &n);
  bool z = true;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x);
    ss[x]++;
  }
  if (ss[0] == n) return !printf("Yes\n");
  int sz = ss.size();
  if (n % 3) {
    return !printf("No\n");
  } else {
    vector<int> a;
    for (auto i : ss) {
      for (int j = 0; j < i.second / (n / 3); j++) a.push_back(i.first);
    }
    if (a.size() == 3 && a[0] ^ a[1] ^ a[2] == 0)
      printf("Yes\n");
    else
      printf("No\n");
  }
}
