#define _CRT_SECURE_NO_WARNINGS

#include<bits/stdc++.h>

using namespace std;

#define PI			atan(1.0)*4
#define OO			1e9
#define SS       	second
#define FF       	first
#define Trace(n)  	cout<< #n <<" = "<< n << endl;
#define ll			long long
#define endl		"\n"

//@formatter:off
int dx[] = { 0, 0, -1, 1, 1, 1, -1, -1 };
int dy[] = { -1, 1, 0, 0, 1, -1, 1, -1 };

void fast()
{
	std::ios_base::sync_with_stdio(0);
	cin.tie(NULL);
	cout.tie(NULL);
}

ll gcd(ll a, ll b) { return !b ? a : gcd(b, a % b); }
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }

//@formatter:on

int main()
{
	fast();
	int n;
	cin >> n;
	int Num;
	set<int> st;
	map<int, int> mp;
	for (int i = 0; i < n; i++)
		cin >> Num, st.insert(Num), mp[Num]++;

	if (st.size() == 1)
	{
		if (mp[0] == n)
			cout << "Yes";
		else
			cout << "No";
	}
	else if (st.size() == 2)
	{
		cout << "No";
	}
	else if (st.size() == 3)
	{
		int cnt = 0;
		vector<int> v(st.begin(), st.end());
		if (v[0] == (v[1] ^ v[2]))
			cnt++;
		if (v[1] == (v[0] ^ v[2]))
			cnt++;
		if (v[2] == (v[0] ^ v[1]))
			cnt++;

		if (cnt == 3 && mp[v[0]] == mp[v[1]] && mp[v[0]] == mp[v[2]])
			cout << "Yes";
		else
			cout << "No";
	}
	else
	{
		cout << "No";
	}
}
