#include <bits/stdc++.h>
using ll = long long int;
static const ll mod = 1e9 + 7;
static const ll INF = 1LL << 50;
using namespace std;
int main() {
  ll n;
  cin >> n;
  vector<ll> a(n), b;
  map<ll, ll> mp;
  for (int i = (int)0; i < (int)n; ++i) {
    cin >> a[i];
  }
  a.push_back(a[0]);
  for (int i = (int)0; i < (int)n; ++i) {
    b.push_back(a[i] ^ a[i + 1]);
  }
  sort(a.begin(), a.end());
  a.erase(a.begin());
  sort(b.begin(), b.end());
  for (int i = (int)0; i < (int)n; ++i) {
    if (a[i] != b[i]) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
