#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = double;
#define fi first
#define se second
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define siz(v) (ll)(v).size()
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define repn(i,n) for(ll i=0;i<=(ll)(n);i++)
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
const ll mod = 1000000007;
const ll INF = 1000000099;
//cin.tie(0);
//ios::sync_with_stdio(false);

signed main(){
    ll n;cin>>n;
    bool ans=true;
    vector<ll> a(n);

    rep(i,n){
        cin>>a[i];
        if(a[i]!=0)ans=false;
    }
    sort(all(a));

    if(n%3!==0){//OK
        if(ans)cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
    }else{//OK
        if(a[0]==a[-1+ n/3] && a[n/3]==a[2*n/3 -1] && a[2*n/3]==a[n-1] && a[0]^a[n-1]==a[n/3] && a[0]^a[n/3]==a[n-1] && a[n-1]^a[n/3]==a[0] ){
            cout<<"Yes"<<endl;
        }else{
            cout<<"No"<<endl;
        }
    }
}