#include <bits/stdc++.h>
using namespace std;
#define rep(i,s,t) for(int i=s;i<t;i++)
#define pii pair<int,int>
map<int,int> mm;
int main()
{
    int n;scanf("%d",&n);int a;
    rep(i,1,n+1)scanf("%d",&a),mm[a]++;
    if(n%3)
    {
        if(mm.size()==1&&mm.begin()->first==0)printf("Yes\n");
        else printf("No\n");
    }
    else{
        vector<pii> v;
        for(auto xx:mm)v.push_back({xx.first,xx.second});
        if(mm.size()==3){
            if(v[0].second==v[1].second&&v[1].second==v[2].second)
            {
                int k1 = v[0].first, k2 = v[1].first, k3 = v[2].first;
                if (k1 ^ k2 == k3 && k1 ^ k3 == k2 && k2 ^ k3 == k1)printf("Yes\n");
                else printf("No\n");
            }
            else printf("No\n");
        }
        else if(mm.size()>3)printf("No\n");
        else if(mm.size()==1){
            if(mm.begin()->first==0)printf("Yes\n");
            else printf("No\n");
        }
        else{
            if(v[0].second!=n/3&&v[1].second!=n/3)printf("No\n");
            else{
                if(v[0].second==n/3)v.push_back(v[1]);
                else v.push_back(v[0]);
                int k1 = v[0].first, k2 = v[1].first, k3 = v[2].first;
                if (k1 ^ k2 == k3 && k1 ^ k3 == k2 && k2 ^ k3 == k1)printf("Yes\n");
                else printf("No\n");
            }
        }
    }
}