#include <bits/stdc++.h>
using namespace std;
map<int, int> mp;
int A[1000003];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &A[i]);
    mp[A[i]]++;
  }
  if (mp.size() == 1) {
    if (mp[0] == n)
      printf("Yes\n");
    else
      printf("No\n");
  } else if (mp.size() >= 4 || n % 3 != 0)
    printf("No\n");
  else if (mp.size() == 3) {
    vector<int> V;
    for (auto it : mp) V.push_back(it.first);
    if (mp[V[0]] != n / 3 || mp[V[1]] != n / 3 || mp[V[2]] != n / 3)
      printf("No\n");
    else if (V[0] != (V[1] ^ V[2]))
      printf("No\n");
    else
      printf("Yes\n");
  }
}
