#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
unordered_map<int, int> mp;
int n, a[maxn];
int tot = 0;
int cnt[maxn];
int b[maxn];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", a + i);
    if (!mp.count(a[i])) {
      mp[a[i]] = ++tot;
      b[tot] = a[i];
    }
    cnt[mp[a[i]]]++;
  }
  int ans = b[1] ^ b[2] ^ b[3];
  if (mp.size() == 1 && b[1] == 0)
    printf("Yes\n");
  else if (mp.size() == 2) {
    if (cnt[1] == cnt[2] * 2 && b[1] == 0) {
      printf("Yes\n");
    } else if (cnt[1] * 2 == cnt[2] && b[2] == 0) {
      printf("Yes\n");
    } else
      printf("No\n");
  } else if (mp.size() == 3 && ans == 0 && n % 3 == 0 && cnt[1] == cnt[2] &&
             cnt[2] == cnt[3])
    printf("Yes\n");
  else
    printf("No\n");
  return 0;
}
