#include <bits/stdc++.h>
using namespace std;
vector<long long> v;
signed main() {
  long long n, a, b, c;
  cin >> n;
  for (long long i = 0; i < (n); i++) {
    long long aa;
    cin >> aa;
    v.push_back(aa);
  }
  sort(v.begin(), v.end());
  a = v[0], b = v[upper_bound(v.begin(), v.end(), v[0]) - v.begin()];
  v.erase(v.begin());
  v.erase(upper_bound(v.begin(), v.end(), v[0]));
  if (binary_search(v.begin(), v.end(), a ^ b)) c = a ^ b;
  v.erase(lower_bound(v.begin(), v.end(), a ^ b));
  for (long long i = 0; i < (n - 3); i++) {
    if (i % 3 == 0) {
      if (binary_search(v.begin(), v.end(), a))
        v.erase(lower_bound(v.begin(), v.end(), a));
      else {
        puts("No");
        return 0;
      }
    }
    if (i % 3 == 1) {
      if (binary_search(v.begin(), v.end(), b))
        v.erase(lower_bound(v.begin(), v.end(), b));
      else {
        puts("No");
        return 0;
      }
    }
    if (i % 3 == 2) {
      if (binary_search(v.begin(), v.end(), c))
        v.erase(lower_bound(v.begin(), v.end(), c));
      else {
        puts("No");
        return 0;
      }
    }
  }
  if (n % 3)
    puts("No");
  else
    puts("Yes");
}
