#include<bits/stdc++.h>
using namespace std;
const int maxn=3e5+10;
map<int,int> ss;
int n,x;

int main(){
    scanf("%d",&n);
    bool zt=true;
    for(int i=1;i<=n;i++){
       scanf("%d",&x);
       ss[x]++;
       z&=(x==0);
    }
    if(z)return !printf("YES\n");
    int sz=ss.size();
    if(n%3){
        printf((sz==1&&(ss.count(0)))?"Yes\n":"No\n");
    }
    else{
        if(!(sz==2||sz==3))return !printf("No\n");
        if(sz==2){
            return !printf((((ss.begin()->first)==0)&&(ss.begin()->second)==(n/3))?"Yes\n":"No\n");
        }
        auto it=ss.begin();
        int a=it->first,aa=it->second;++it;
        int b=it->first,bb=it->second;++it;
        int c=it->first,cc=it->second;
        if(!(aa==bb&&bb==cc))return !printf("No\n");
        if(a^b!=c)return !printf("No\n");
        printf("Yes\n");
    }
}
