#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#define max(a, b)	(((a) > (b)) ? (a) : (b))		/* ２個の値の最大値 */
#define min(a, b)	(((a) < (b)) ? (a) : (b))		/* ２個の値の最小値 */
#define ENTER		printf("\n")					/* 改行プリント */
int DBG = 1;										/* デバッグプリント 提出時は0 */
/* main *************************************************************/
int compare4(const void *a, const void *b) {
	int aa = *((int *)a);
	int bb = *((int *)b);
	if (aa > bb) return 1;
	if (aa < bb) return -1;
	return 0;
}
void qsort4(int *base, int count) {
	/* void qsort(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *)); */
	qsort((void *)base, count, sizeof(int), compare4);
}
int *bsearch4(int *key, int *base, int count) {
	/* void *bsearch(const void *key, const void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)); */
	return bsearch((void *)key, (void *)base, count, sizeof(int), compare4);
}
int main()
{
	int		N,a[100000],b[100000],bb,b0,b1,f,c,i,j,k,n,m,x,y,key,ans = 0;
	char	str[256];
	int		*pt;

	scanf("%d", &n);
	N = n;
	for(i=0;i<n;i++) scanf("%d",&a[i]);
	qsort4(a, N);

	i=0;f=0;
	for(j=1;j<n-1;j++) {
		key=a[j]^a[i];
		if ( (pt = bsearch4(&key,a,N)) !=NULL) {
			f = 1;
			goto A;
		}
	}
	A:
	if (f) {
		b[0] = a[i];
		b[1] = a[j];
		b[2] = *pt;
		a[i] = a[n-3];
		a[j] = a[n-2];
		*pt = a[n-1];
		n -= 3;
	} else {
		printf("No\n");
		return 0;
	}

	for(bb=2;bb<N-1;bb++) {
		b0 = bb-1;
		b1 = bb+1;
		f = 0;
		for(i=0;i<n;i++) {
			if ((b[b0]^a[i])==b[bb]) {
				b[b1] = a[i];
				a[i] = a[n-1];
				f = 1;
				n--;
				break;
			}
		}
		if (f==0) {
			printf("No\n");
			return 0;
		}
	}

	if (b[0]^b[N-2]==b[N-1]) printf("Yes\n");
	else printf("No\n");

	return 0;
}
