#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cstring>
using namespace std;
#define ll long long
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define FORD(i,a,b) for(int i=a;i>=b;i--)
#define FORL(i,x) for(int i=head[x];i;i=nxt[i])
#define clr(x,y) memset(x,y,sizeof(x))
#define in(a) a=read()
#define out(a) printf("%d\n",a)
inline ll read(){
    char c=getchar();ll f=1,x=0;
    while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}
    while(c>='0'&&c<='9')x=x*10+(c-'0'),c=getchar();
    return x*f;
}
#define mod 1000000007
void MOD(int &x){if(x>=mod)x-=mod;}
#define maxn 100010
#define inf (1<<30)
int b[maxn],a[maxn];
int main(){
	int n;
	in(n);
	FOR(i,1,n){
		in(a[i]);
	}
	sort(a+1,a+n+1);
	int cnt=0;
	FOR(i,1,n)
		if(a[i]!=a[i-1]){
			b[++cnt]=a[i];
		}
	if(cnt>3)puts("No");
	else {
		if(n%3==0){
			if(cnt>3)puts("No");
			if((b[1]^b[2])==b[3]||(b[2]^b[3])==b[1]||(b[3]^b[1])==b[2]))puts("Yes");
			else puts("No");
		}
		else if(cnt<=1&&(b[1]^b[1])==0)puts("Yes");
		else puts("No");
	}
}
