#include <iostream>
#include <vector>

using namespace std;
typedef long long ll;
#define REP(i,n) FOR(i,0,n)
#define FOR(i,a,b) for(ll i=(a),i##Len_=(b);i<i##Len_;i++)
 

int main()
{
	ll N;
	cin >> N;

	string res = "No";

	vector <ll> a(1000000009,0);
	vector <ll> acnt(1000000009,0);

	bool zeroari = false;
	bool allzero = true;
	REP(i,N)
	{
		cin >> a[i];
		acnt[a[i]]++;
		
		if(a[i] != 0)
		{
			allzero = false;
		}
		else
		{
			zeroari = true;
		}
	}

	if(allzero)
	{
		cout << "Yes" << endl;
		return 0;
	}


	//3で割り切れなければ満たせない
	if(N % 3 == 0)
	{
		ll Nb3 = N/3;

		if(zeroari)
		{
			//zero-> Nb3枚
			REP(i,N)
			{
				if(a[i] != 0)
				{
					ll x = a[i];
					if(acnt[x] == 2 * Nb3 && acnt[0] == Nb3)
					{
						res = "Yes";
					}
					break;
				}
			}
		}
		else
		{
			// x と y と x^y
			REP(i,N)
			{
				if(a[0] != a[i])
				{
					ll x = a[0];
					ll y = a[i];
					ll z = x^y;

					if(acnt[x] == Nb3 && acnt[y] == Nb3 && acnt[z] == Nb3)
					{
						res = "Yes";
					}
					break;
				}
			}
		}
	}

	cout << res << endl;

}#include <iostream>
#include <vector>

using namespace std;
typedef long long ll;
#define REP(i,n) FOR(i,0,n)
#define FOR(i,a,b) for(ll i=(a),i##Len_=(b);i<i##Len_;i++)
 

int main()
{
	ll N;
	cin >> N;

	string res = "No";

	vector <ll> a(1000000009,0);
	vector <ll> acnt(1000000009,0);

	bool zeroari = false;
	bool allzero = true;
	REP(i,N)
	{
		cin >> a[i];
		acnt[a[i]]++;
		
		if(a[i] != 0)
		{
			allzero = false;
		}
		else
		{
			zeroari = true;
		}
	}

	if(allzero)
	{
		cout << "Yes" << endl;
		return 0;
	}


	//3で割り切れなければ満たせない
	if(N % 3 == 0)
	{
		ll Nb3 = N/3;

		if(zeroari)
		{
			//zero-> Nb3枚
			REP(i,N)
			{
				if(a[i] != 0)
				{
					ll x = a[i];
					if(acnt[x] == 2 * Nb3 && acnt[0] == Nb3)
					{
						res = "Yes";
					}
					break;
				}
			}
		}
		else
		{
			// x と y と x^y
			REP(i,N)
			{
				if(a[0] != a[i])
				{
					ll x = a[0];
					ll y = a[i];
					ll z = x^y;

					if(acnt[x] == Nb3 && acnt[y] == Nb3 && acnt[z] == Nb3)
					{
						res = "Yes";
					}
					break;
				}
			}
		}
	}

	cout << res << endl;

}