#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
map<ll,ll> m;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll n;
    cin>>n;
    for(ll i=0;i<n;i++){
        ll x;
        cin>>x;
        if(m.find(x)==m.end())
        m.insert({x,0});
        m[x]++;
    }
    ll a=m.begin()->first,c=prev(m.end(),1)->first;
    if(a==0&&m[a]==n)
    cout<<"Yes";
    else if(n%3==0){
        if(m.size()==2){
            if(a==0&&m[a]==n/3&&m[c]==2*n/3)
            cout<<"Yes";
            else
            cout<<"No";
        }
        else if(m.size()==3){
            b=next(m.begin(),1)->first;
            if((a^b^c==0)&&m[a]==n/3&&m[b]==n/3&&m[c]==n/3)
            cout<<"Yes";
            else
            cout<<"No";
        }
    }
    else
    cout<<"No";
}