#include <iostream>
#include <string>
#include <vector>
#include <algorithm> // sort
#include <map> // pair
#include <queue>
#include<iomanip>
#include <cmath>
#include <set>

#define ABS(x) ((x)>0?(x):-(x))
#define MIN(x,y) ((x)>(y)?(y):(x))

using namespace std;
typedef long long ll;

ll newton(long long int a, long long int  b)
{
	if(a==b)
		return a;
	while(a != 0 && b != 0)
	{
		if(a > b)
		{
			b += a;
			a = b-a;
			b -= a;
		}
		b %= a;
	}
	return a;
}

struct UnionFind {
	vector<int> p;
	UnionFind(int N):p(N)
	{
		for(int i=0; i< N; i++)
		{
			p[i] = i;
		}
	}
	int root(int x)
	{
		if(p[x] == x)
			return x;
		return p[x] = root(p[x]);
	}
	void unite(int x, int y)
	{
		int rx = root(x);
		int ry = root(y);
		if(rx == ry) return;
		p[rx] = ry;
	}
	bool issame(int x, int y)
	{
		int rx = root(x);
		int ry = root(y);
		return rx == ry;
	}
};

//大きな数に対する割り算をするとき、MODを指定することで掛け算の値に変換できる

ll div2mul_calc(ll a, ll b, ll m)
{
	if (b == 0) {
        return 1;
    } else if (b % 2 == 0) {
        ll d = div2mul_calc(a, b / 2, m);
        return (d * d) % m;
    } else {
        return (a * div2mul_calc(a, b - 1, m)) % m;
    }
}
ll div2mul(ll n, ll mod)
{
	return div2mul_calc(n, mod-2, mod);
}

ll twoRow(ll a, ll b, ll mod)
{
	ll ret = 1;
	for(ll i = 1 ;i <= a+b;++i)
	{
		ret *= i;
		ret %= mod;
	}
	for(ll i = 1 ;i <= a;++i)
	{
		ret *= div2mul(i,mod);
		ret %= mod;
	}
	for(ll i = 1 ;i <= b;++i)
	{
		ret *= div2mul(i,mod);
		ret %= mod;
	}
	return ret;
}



int main()
{
	int N;
	int K[3] = {-1,-1,-1};
	//int K[3] = {0};
	unsigned int C[3] = {0};
	int pos = 0;
	unsigned int A[100010]={0};
	unsigned int i,j,k;
	cin >> N;
	for(i=0;i<N;++i)
	{
		cin >> A[i];
	}
	k = 1;
	for(i=0;i<N;++i)
	{
		if(A[i] != 0)
		{
			k=0;
			break;
		}
	}
	if(k==1)
	{
		//
		cout << "Yes" << endl;
	}
	else
	{
		for(i=0;i<N;++i)
		{
			k=0;
			for(j=0;j<pos;++j)
			{
				if(K[j] == A[i])
				{
					C[j]++;
					k=1;
					break;
				}
			}
			if(k==0)
			{
				if(pos == 3)
				{
					pos = 4;
					break;
				}
				K[pos] = A[i];
				C[pos] = 1;
				pos++;
			}
		}
		if(pos==3&&C[0]==C[1]&&C[0]==C[2]&&((K[0]^K[1]^K[2])==0))
		{
			cout << "Yes" << endl;
		}
		else if(pos==2&&((C[0]*2==C[1]&&K[0]==0)||(C[0]==C[1]*2&&K[1]==0)))
		{
			cout << "Yes" << endl;
		}
		else
		{
			cout << "No" << endl;
		}
	}

	return 0;
}

/*
int main()
{
	int N,M;
	int i,j,k;
	int p,r,s,t;
	set<int>::iterator itr;
	set<int> mp[100010];
	vector<int> ans[100010];
	int end[100010] = {0};
	int can = 1;
	cin >> N>>M;
		for(i=0;i<M;++i)
		{
			cin>>j>>k;
			--j;--k;
			mp[j].insert(k);
			mp[k].insert(j);
		}
	if((M&1)==0)
	{
		queue<int> q;
		for(i=0;i<N;++i)
		{
			if(mp[i].size()==1&&!end[i])
			{
				q.push(i);
				while(!q.empty())
				{
					p=q.front();
					q.pop();
					r = mp[p].size();
					s = ans[p].size();
					if(r==1)
					{
						end[p] = 1;
						if(s&1)
						{
							itr = mp[p].begin();
							t = *itr;
							ans[p].push_back(t);
							if(!end[t])
							{
								q.push(t);
							}
							mp[t].erase(p);
							mp[p].erase(itr);
						}
						else if(r > 0)
						{
							itr = mp[p].begin();
							t = *itr;
							ans[t].push_back(p);
							if(!end[t])
							{
								q.push(t);
							}
							mp[t].erase(p);
							mp[p].erase(itr);
						}
					}
					else if(r==0 && (s&1))
					{
						can = 0;
						break;
					}
				}
				if(!can)
					break;
			}
			if(!can)
				break;
		}
		if(can)
		{
			for(i=0;i<N;++i)
			{
				if(!end[i])
				{
					r = mp[i].size();
					s = ans[i].size();
					k = (r-(r+s)%2);
					for(j=0;j<k;++j)
					{
						itr = mp[i].begin();
						t = *itr;
						ans[i].push_back(t);
						mp[t].erase(i);
						mp[i].erase(itr);
						if(mp[t].size()==1)
						{
							q.push(t);
						}
					}
					end[i] = 1;

					while(!q.empty())
					{
						p=q.front();
						q.pop();
						r = mp[p].size();
						s = ans[p].size();
						if(r==1)
						{
							end[p] = 1;
							if(s&1)
							{
								itr = mp[p].begin();
								t = *itr;
								ans[p].push_back(t);
								if(!end[t])
								{
									q.push(t);
								}
								mp[t].erase(p);
								mp[p].erase(itr);
							}
							else if(r > 0)
							{
								itr = mp[p].begin();
								t = *itr;
								ans[t].push_back(p);
								if(!end[t])
								{
									q.push(t);
								}
								mp[t].erase(p);
								mp[p].erase(itr);
							}
						}
						else if(r==0 && (s&1))
						{
							can = 0;
							break;
						}
					}

					if(!can)
						break;
				}

				if(!can)
					break;
			}
		}
		if(can)
		{
			for(i=0;i<N;++i)
			{
				s = ans[i].size();
				for(j=0;j<s;++j)
				{
					cout << i+1 << " " << ans[i][j]+1 << endl;
				}
			}
		}
		else
		{
			cout << -1 << endl;
		}
	}
	else
	{
		cout << -1 << endl;
	}
	return 0;
}
*/





















Measured memory_bytes: 640