#include<bits/stdc++.h> 
 
#define hell                         1000000007
#define hell2                        998244353
#define lcm(a,b)                     (a*b)/__gcd(a,b)
#define ll                           long long
#define vll                          vector<ll>
#define vi                           vector<int>
#define pll                          vector< pair<ll,ll> >
#define pb                           push_back
#define mp                           make_pair
#define all(v)                       v.begin(),v.end()
#define lbnd                         lower_bound
#define ubnd                         upper_bound
#define bs                           binary_search
#define F                            first
#define S                            second
#define rep(i,a,b)                   for(ll i=a;i<b;i++)
#define parr(a,n)                    for(ll it=0;it<n;it++) cout<<a[it]<<" ";cout<<endl;
#define pcont(a)                     for(auto it:a) cout<<it<<" ";cout<<endl;
#define ret(x)                       return cout<<x,0;
//#define endl                           '\n'
 
#define MAX 300005
using namespace std;

bool check(map<ll,ll> m, ll n) {
    if(n%3!=0) return false;
    if(m.size()!=3) return false;
    vll v;
    for(auto it:m) {
        if(it.S!=n/3) return false;
        v.pb(it.F);
    }
    if(v[0]^v[1]^v[2]!=0)return false;
    return true;
}

bool check2(map<ll,ll> m, ll n) {
    if(m.size()!=2) return false;
    vll v;
    for(auto it:m) {
        v.pb(it.F);
    }
    if(m[v[0]]==(2*n)/3 && m[v[1]]==n/3) return true;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);

    ll n;
    cin >> n;
    map<ll,ll> m;
    ll a[n];
    rep(i,0,n) {
        cin >> a[i];
        m[a[i]]++;
    }

    sort(a,a+n);
    if(a[0]==a[n-1] && a[0]==0) ret("Yes");

    ll a = check(m,n);
    ll b = check2(m,n);
    if(a || b) ret("Yes");
    ret("No");
}

