#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<long long int> a(n);
  for (int i = 0; i < (n); ++i) cin >> a[i];
  bool isAllZero = true;
  int zero = 0;
  for (int i = 0; i < (n); ++i) {
    isAllZero &= (a[i] == 0);
    zero += (a[i] == 0);
  }
  map<long long int, int> mp;
  for (int i = 0; i < (n); ++i) {
    mp[a[i]]++;
  }
  bool ok = true;
  int num = n / 3;
  if (mp.size() == 3) {
    for (int i = 1; i < n; ++i) {
      if (a[i] != a[0]) {
        int x = a[0], y = a[i], z = x ^ y;
        if (mp.count(z)) {
          if (mp[x] == num && mp[y] == num && mp[z] == num) {
            ok = true;
          } else {
            ok = false;
          }
        }
      }
    }
  } else if (mp.size() == 2) {
    for (auto it : mp) ok &= (it.second == n / 3 || it.second == (2 * n / 3));
    ok &= (zero == n / 3);
  } else {
    ok = isAllZero;
  }
  if (ok) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
