//#pragma GCC optimize(2)
//#pragma GCC optimize(3)
#include<bits/stdc++.h>
//#include <bits/extc++.h>
#define fi first
#define se second
#define db double
#define mp make_pair
#define pb push_back
#define mt make_tuple
//#define pi acos(-1.0)
#define ll long long
#define vi vector<int>
#define mod 1000000007
#define ld long double
#define ls l,m,rt<<1
#define rs m+1,r,rt<<1|1
#define pll pair<ll,ll>
#define pil pair<int,ll>
#define pli pair<ll,int>
#define pii pair<int,int>
#define ull unsigned long long
#define bpc __builtin_popcount
#define base 1000000000000000000ll
#define fin freopen("a.txt","r",stdin)
#define fout freopen("a.txt","w",stdout)
#define mr mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
inline ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
inline void sub(ll &a,ll b){a-=b;if(a<0)a+=mod;}
inline void add(ll &a,ll b){a+=b;if(a>=mod)a-=mod;}
inline ll mul(ll a,ll b,ll c){return (a*b-(ll)((ld)a*b/c)*c+c)%c;}
inline ll qp(ll a,ll b){ll ans=1;while(b){if(b&1)ans=ans*a%mod;a=a*a%mod,b>>=1;}return ans;}
inline ll qp(ll a,ll b,ll c){ll ans=1;while(b){if(b&1)ans=mul(ans,a,c);a=mul(a,a,c),b>>=1;}return ans;}

using namespace std;
//using namespace __gnu_pbds;

const ld pi = acos(-1);
const ull ba=233;
const db eps=1e-5;
const ll INF=0x3f3f3f3f3f3f3f3f;
const int N=16000+10,maxn=2000000+10,inf=0x3f3f3f3f;

map<int,int>ma;
int main()
{
    int n;scanf("%d",&n);
    for(int i=1;i<=n;i++)
    {
        int x;scanf("%d",&x);
        ma[x]++;
    }
    if(ma.size()==1)return 0*puts(ma.begin()->fi?"No":"Yes");
    if(ma.size()==2)
    {
        if(ma.begin()->fi!=0)return 0*puts("No");
        if((--ma.end())->se)-ma.begin()->se>1||(--ma.end())->se)-ma.begin()->se<0)return 0*puts("No");
//        puts("___");
        return 0*puts("Yes");
    }
    if(n%3!=0||ma.size()>3)puts("No");
    else
    {
        auto te=ma.begin();
        int x=te->fi;
        if(te->se!=n/3)return 0*puts("No");
        te++;
        int y=te->fi;
        if(te->se!=n/3)return 0*puts("No");
        te++;
        int z=te->fi;
        if(te->se!=n/3)return 0*puts("No");
        puts(((x^y)==z)?"Yes":"No");
    }
    return 0;
}
/********************
5
1 0 1 0 2
********************/
