#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);
  map<ll, ll> mp;
  for (int i = (int)0; i < (int)n; ++i) {
    cin >> a[i];
    mp[a[i]]++;
  }
  a.push_back(a[0]);
  for (int i = (int)0; i < (int)n; ++i) {
    if (mp[a[i] ^ a[i + 1]] == 0) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
