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