#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>
#include<boost/operators.hpp>

namespace adaptor = boost::adaptors;

bool run(std::map<int, int>const& count, int N)
{
	if (count.size() > 3)
	{
		return false;
	}
	std::vector<int> vals;
	for (auto&& p : count)
	{
		vals.emplace_back(p.first);
	}
	if (vals.size() == 1)
	{
		return true;
	}
	else if (vals.size() == 2)
	{
		if (vals[0] == 0)
		{
			return 2 * count.at(vals[0]) == count.at(vals[1]);
		}
		else
		{
			return false;
		}
	}
	else
	{
		if (N % 3 != 0)
		{
			return false;
		}
		if (vals[0] ^ vals[1] == vals[2])
		{
			return count.at(vals[0]) == count.at(vals[1]) && count.at(vals[1]) == count.at(vals[2]);
		}
		return false;
	}
}

void Main()
{
	int N;
	std::cin >> N;
	std::map<int, int> count;
	for (auto i : boost::irange(0, N))
	{
		int v;
		std::cin >> v;
		++count[v];
	}
	if (run(count, N))
	{
		std::cout << "Yes" << std::endl;
	}
	else
	{
		std::cout << "No" << std::endl;
	}
}

int main()
{
	std::cin.tie(nullptr);
	std::ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
	Main();
}