//Utkarsh.25dec
#include <bits/stdc++.h>
#define ll long long int 
#define ull unsigned long long int
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define rep(i,n) for(ll i=0;i<n;i++)
#define loop(i,a,b) for(ll i=a;i<=b;i++)
#define vi vector <int>
#define vs vector <string>
#define vc vector <char>
#define vl vector <ll>
#define all(c) (c).begin(),(c).end()
#define max3(a,b,c) max(max(a,b),c)
using namespace std;
const int N=500023;
bool vis[N];
vector <int> adj[N];
void solve()
{
    ll n;
    cin>>n;
    vl v;
    map <ll,ll> cnt;
    ll dis=0;
    vl numbers;
    rep(i,n)
    {
        ll c;
        cin>>c;
        v.pb(c);
        if(cnt[c]==0)
        {
            dis++;
            numbers.pb(0);
        }
        cnt[c]++;
    }
    if(n==3)
    {
        if((v[0]^v[1])==v[2])
            cout<<"Yes";
        else
            cout<<"No";
        return;    
    }
    if(dis>3)
    {
        cout<<"No";
        return;
    }
    if(dis==3)
    {
        if(n%3!=0)
        {
            cout<<"No";
            return;
        }
        if(cnt[numbers[0]]==(n/3)&&cnt[numbers[1]]==(n/3)&&cnt[numbers[2]]==(n/3))
        {
            if((numbers[0]^numbers[1])==(numbers[2]))
                cout<<"Yes";
            else
                cout<<"No";
            return;
        }
        else
        {
            cout<<"No";
            return;
        }
    }
    else if(dis==2)
    {
        if(n%3!=0)
        {
            cout<<"No";
        }
        else
        {
            if(cnt[0]==(n/3)
                cout<<"Yes";
            else
                cout<<"No";
        }
        return;
    }
    else if(dis==1)
    {
        if(cnt[0]==n)
            cout<<"Yes";
        else
            cout<<"No";
    }
}
int main()
{
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL);
    int T=1;
    //cin>>T;
    int t=0;
    while(t++<T)
    {
        //cout<<"Case #"<<t<<":"<<' ';
        solve();
        //cout<<'\n';
    }
}