#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
int n;
vector<int> cnt[maxn];
map<int, int> num;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= (n); i++) {
    int x;
    scanf("%d", &x);
    num[x]++;
  }
  for (map<int, int>::iterator it = num.begin(); it != num.end(); it++)
    cnt[it->second].push_back(it->first);
  if (n % 3 == 0) {
    if (num.count(0)) {
      if (num[0] == n || (num[0] == n / 3 && !cnt[n / 3 * 2].empty()))
        puts("Yes");
      else
        puts("No");
    } else {
      if (int(cnt[n / 3].size()) == 3 &&
          (cnt[n / 3][0] ^ cnt[n / 3][1] == cnt[n / 3][2]))
        puts("Yes");
      else
        puts("No");
    }
  } else {
    puts(num.count(0) && num[0] == n ? "Yes" : "No");
  }
  return 0;
}
