#include <iostream>
#include <map>
using namespace std;
#define rep(i,a,b) for(int i=a;i<=b;i++)
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
#define ll long long
ll a[100005];
int main(int argc, char** argv) {
	map<int,int>cnt,vis; 
	int n;
	cin>>n;
	ll ans=0,a2=0,aa=0,b=0,c=0; 
	rep(i,1,n)
	scanf("%lld",&a[i]),cnt[a[i]]++,ans^=a[i],a2=max(a2,a[i]);
	rep(i,1,n)
	{
		if(!aa&&!vis.count(a[i]))aa=a[i];
		else if(!b&&!vis.count(a[i]))b=a[i];
		else if(!c&&!vis.count(a[i]))c=a[i];
		vis[a[i]]++;
	}
	if(n==3&&a[1]^a[2]^a[3]==0))
	{
		printf("Yes");
		return 0;
	}
	if(a2==0)
	{
		printf("Yes");
		return 0;
	}

	if(ans!=0||(n%3!=0)||(!aa||!b||!c)||(aa^b!=c)||(cnt[aa]!=cnt[b])||(cnt[aa]!=cnt[c]))
	{
		printf("No");
		return 0;
	}
	printf("Yes");
	
	
	return 0;
}