#include<bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define ll long long
#define mm 1000000007
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define pii pair<int, int>
#define pll pair<ll, ll>

#define show(x) cout<<#x<<" "<<x<<'\n'
#define iosbase ios_base::sync_with_stdio(false); cin.tie(NULL);
#define oset tree<int , null_type, less_equal<int> , rb_tree_tag, tree_order_statistics_node_update>

using namespace std;
using namespace __gnu_pbds;

int main()
{
    iosbase;
    
    int n;
    cin>>n;
    
    unordered_map<int,int > m;
    
    for(int i=0;i<n;i++)
    {
        int x;
        cin>>x;
        m[x]++;
    }
    
    if(m.size()>3 || m.size()==1)
    {
        //cout<<"here1"<<endl;
        cout<<"No";
        return 0;
    }
    if(m.size() == 3)
    {
        if(n%3)
        {
           // cout<<"here2"<<endl;
            cout<<"No";
            return 0;
        }
        int a[3],i=0;
        for(auto itr=m.begin();itr != m.end();itr++)
        {
            a[i]= itr->ff;
            int cnt= itr->ss;
            if(cnt != n/3)
            {
                //cout<<"here3"<<endl;
                cout<<"No";
                return 0;
            }
            i++;
        }
        //show(a[0]);show(a[1]);show(a[2]);
        if((a[0]^a[1]) != a[2])
        {
            //cout<<"here4"<<endl;
            cout<<"No";
            return 0;
        }
        
        cout<<"Yes";
        return 0;
    }
    
    if(m.size() == 2)
    {
        if(m[0] ==0 || m[1]==0)
        {
            cout<<"No";
            return 0;
        }
        
        if((m[1]==2 && m[0]==1) || (m[1]==1 && m[0] ==2))
        {
            cout<<"Yes";
            return 0;
        }
        
        cout<<"No";
        return 0;
    }
    return 0;
}