#include <bits/stdc++.h>
using namespace std;
int main(void){
    int n; cin>>n;
    vector <int> a(n);
    map <int,int> ma;
    for(int i=0;i<n;i++){
        cin>>a[i];
        ma[a[i]]++;
    }
    int cnt0=count(a.begin(), a.end(), 0);
    if(count(cnt == n) {cout<<"Yes"<<endl; return 0;}
    sort(a.begin(),a.end());
    a.erase(unique(a.begin(), a.end()), a.end());
    if(n/3 != 0) {cout<<"No"<<endl; return 0;}
    else{
        if(cnt0== n/3&&mp.size()==2) {cout<<"Yes"<<endl; return 0;}
        if(mp.size()==3){
            if(a[0]==(a[1]^a[2]) && a[1] == (a[2]^a[0]) && a[2] == (a[0]^a[1])) {cout<<"Yes"<<endl; return 0;}
        }
    }
    cout<<"No"<<endl;
}
