#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define rep1(i, n) for(ll i = 1; i < n+1; i++)
#define all(A) A.begin(),A.end()
typedef long long ll;

ll main(){
  
  ll n;
  cin >> n;
  vector<ll> a(n);
  map<ll,ll> init;
  rep(i,n){
    cin >> a[i];
    init[a[i]] ++;
  }
  a.push_back(a.front());
  map<ll,ll> xini;
  rep(i,n){
    ll x = a[i]^a[i+1];
    xini[x] ++;
  }
  if(init == xini) cout << "Yes" << endl;
  else cout << "No" << endl;
}