#include <iostream>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <algorithm>
#include <cmath>
#include <vector>
#include <regex> //正規表現
#include <map>
#include <set>
#include <cassert> //assart
#include <numeric>

using namespace std;
#define ll long long int
#define FOR(i,min,max) for(int i=(min);i<(max);i++)
#define FOReq(i,min,max) for(int i=(min);i<=(max);i++)
#define FORREV(i,max,min) for(int i=(max)-1;i>=(min);i--)
#define FORREVeq(i,max,min) for(int i=(max);i>=(min);i--)
const int  MOD=1e9+7;
const int  INF=2000000000;
const int INF2=  10000000;
const double  Micro=1e-5;

int UnUsedVariable(){
    if(INF || Micro || MOD || INF2){;}
    return 0;
}

#define pf printf
#define sf scanf
#define inarray(array,min,max) FOR(i,min,max){cin>>array[i];}
#define inarrayW(arrayA,arrayB,min,max) FOR(i,min,max){cin>>arrayA[i]>>arrayB[i];}
inline int isEven(int x){return x%2==0;}
inline int isOdd (int x){return x%2==1;}
#define br printf("\n");
#define OutputAndReturn0(x) {cout<<(x)<<endl;return 0;}

int EintN(int array[],const int num){
    for(int i=0;i<num;i++){printf("%d ",array[i]);}
    br;
    return 0;
}
int EintNN(const int heighth,const int width,int array[heighth][width]){
    FOR(i, 0, heighth){
        FOR(k, 0, width){
            {printf("%d ",array[i][k]);}
        }
        br;
    }
    br;
    return 0;
}
int E(string str,const int num){
    cerr<<str<<" is "<<num<<" now."<<endl;
    return 0;
}
//#define int long long int

/*
 1.困った時こそ冷静に問題文を見直す！制約条件を見ろ！乱択アルゴリズムとかO(N^3)とか！
 2.一度に大量のことをやろうとしない。デバッグしやすいように細かく！
 3.プログラミングは半分数学だし、もう半分は数学ではない！
 4.できない問題はできない！！！！！
 */

long long IntPow(long long x, long long n){
    if(n == 0)
        return 1;
    if(n % 2 == 0)
        return IntPow(x * x, n / 2);
    else
        return x * IntPow(x, n - 1);
}
int BitN(int n){
    assert(n>=0);
    return (int)IntPow(2, n);
}

int experiment(){
    int ans;ans=0;
    
    return 0;
}
int Ap(){
    int ans;ans=0;
    int N;cin>>N;
    int a[N];
    inarray(a, 0, N);
    
    int bitsumA=0;
    FOR(i, 0, N){
        bitsumA = bitsumA ^ a[i];
    }
    if(bitsumA!=0){OutputAndReturn0("No");}
    
    if(N%3!=0){
        bool temp=true;
        FOR(i, 0, N){
            if(a[i]!=0){temp=false;}
        }
        if(temp){OutputAndReturn0("Yes");}
        else {OutputAndReturn0("No");}
    }
    
   
    int standbitnum[33]={};
    FOR(i, 0, N){
        FOReq(k, 0, 30){
            standbitnum[k]+=( (a[i] & BitN(k) )!=0);
        }
    }
    
    bool temp3=true;
    FOR(k, 0, 31){
        if(standbitnum[k]!=N*2/3 && standbitnum[k]!=0){temp3=false;}
    }
    if(!temp3){OutputAndReturn0("No");}
   
    
    int KindOfNum[9]={};
    int Kind=1;
    FOR(i, 0, N){
        bool writeenNumber=false;
        FOR(k, 0, 9){
            if(KindOfNum[k]==a[i]){writeenNumber=true;}
        }
        if(writeenNumber==false){
            if(Kind==9){OutputAndReturn0("No");}
            KindOfNum[Kind]=a[i];
            Kind++;
        }
    }
    OutputAndReturn0("Yes");
    
    OutputAndReturn0(0);
    return 0;
}

int Bp(){
    int ans;ans=0;
    
    
    return 0;
}

int Cp(){
    int ans;ans=0;
    
    return 0;
}

int Dp(){
    int ans;ans=0;
    
    return 0;
}

void printb(unsigned int v) {
    unsigned int mask = (int)1 << (sizeof(v) * CHAR_BIT - 1);
    do putchar(mask & v ? '1' : '0');
    while (mask >>= 1);
}
void putb(unsigned int v) {
    putchar('0'), putchar('b'), printb(v), putchar('\n');
}

signed main(){
    Ap();
    //Bp();
    //Cp();
    //Dp();
    //Ep();
    //Fp();
    //experiment();
    return 0;
}



Measured memory_bytes: 640