#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  long long n;
  cin >> n;
  long long a[n];
  map<long long, bool> mp;
  for (long long i = (long long)(0); i < (long long)(n); ++i) {
    cin >> a[i];
    mp[a[i]] = true;
  }
  vector<long long> v;
  v.push_back(a[0]);
  mp[a[0]] = false;
  long long now = a[0];
  for (long long i = (long long)(1); i < (long long)(n); ++i) {
    if (mp[a[i]] == false) {
      continue;
    }
    mp[a[i]] = false;
    long long b = (now ^ a[i]);
    if (mp[b] == false) {
      cout << "No" << endl;
      return 0;
    }
    v.push_back(a[i]);
    v.insert(v.begin(), b);
    mp[b] = false;
  }
  for (long long i = (long long)(0); i < (long long)(n); ++i) {
    if (v[i] != (v[(i - 1 + n) % n] ^ v[(i + 1) % n])) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
