#include <bits/stdc++.h>
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize(4)
using namespace std;
int n, a;
map<int, int> mp;
int x[3], cnt = 0;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &a), mp[a]++;
  if (mp.find(0) != mp.end() && mp[0] == n) return 0 * puts("Yes");
  if (n % 3 != 0) return 0 * puts("No");
  if (mp.size() % 3 != 0) return 0 * puts("No");
  for (auto it : mp)
    if (it.second != n / 3) return 0 * puts("No");
  for (auto it : mp) x[cnt++] = it.first;
  if ((x[0] ^ x[1]) != x[2]) return 0 * puts("No");
  puts("Yes");
  return 0;
}
