#include <bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
#define inf 1000000000
#define md 1000000007
#define pb push_back
#define li 100005
#define int long long
using namespace std;
int n,A[li],B[li];
map<int,int> tp,zp;
main(){
	scanf("%lld",&n);
	for(int i=1;i<=n;i++) {scanf("%lld",&A[i]);zp[A[i]]++;}
	B[1]=A[1];
	B[2]=A[2];
	for(int i=3;i<=n;i++){
		B[i]=A[1]^A[2];
	}
	if(B[1]!=(B[2]^B[n])){
		printf("No\n");
		return 0;
	}
	for(int i=1;i<=n;i++){
		tp[B[i]]++;
	}
	for(int i=1;i<=n;i++){
		if(zp[A[i]]!=tp[A[i]]){
			printf("No\n");
			return 0;
		}
	}
	printf("Yes\n");
	return 0;
}


