#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define all(a) 			a.begin(),a.end()
#define pb 				push_back
#define vi				vector<int>
#define vl 				vector<long long>
#define MOD 			1000000007
#define FOR(i,a,b) 		for(int i = a; i <= b ; i++)
#define forn(i,n) 		for(int i = 0 ; i < n; i++)
#define br 				cout<<endl;
#define testc()			int t;cin>>t;while(t--)
#define ll				long long
#define printv(v)		for(auto x : v) cout<<x<<' ';br;
#define ff				first
#define ss 				second
#define fast 			ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define vb 				vector<bool>
#define INF				INT_MAX
#define INFL			LLONG_MAX

using namespace std;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using ld = long double;
using namespace __gnu_pbds;

template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;


vi prime_generator()
{
	vector<int> pr;
	const int N = 10000000;
	vi lp(N+1);
	

	for (int i=2; i<=N; ++i) {
	    if (lp[i] == 0) {
	        lp[i] = i;
	        pr.push_back (i);
	    }
	    for (int j=0; j<(int)pr.size() && pr[j]<=lp[i] && i*pr[j]<=N; ++j)
	        lp[i * pr[j]] = pr[j];
	}
}


vi z_function(string t)
{
	int n = t.size();
	vi z(t.size());
	for(int i = 1,r = 0,l = 0 ; i <  n ; i++)
	{
		if(i <= r)
			z[i] = min(r - i + 1,z[i - l]);
		while(i + z[i] < n && t[z[i]] == t[i + z[i]])
			z[i]++;
		if(i + z[i] - 1 > r)
			r = i + z[i] - 1,l = i;
	}
	return z;
}


ll power(ll a,ll b,ll mod)
{
	ll res = 1;
	a = a % mod;
	while(b)
	{
		if(b & 1)
			res = (res * a) % mod;
		b = b >> 1;
		a = (a * a) % mod;
	}
	return res;
}

template<typename T>
void answer(T s)
{
	cout<<s<<endl;
	exit(0);
}
//use for string in strcpy([string],s.c_str())
//stringstream fs---->fs>>string_name**this will copy the value from fs to string_name
/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/


int main()
{
	fast
	int n;cin>>n;
	multiset<int> a;
	set<int> b;
	int x;
	forn(i,n)
	{
		cin>>x;
		b.insert(x);
		a.insert(x);
	}	if(*(b.begin()) == 0 && b.size() == 1)
		{
			answer("YES");
		}

	if(n % 3)answer("NO");
		if(b.size() == 2)
	{
		for(auto y : b)
		{
			if(!y)
				answer("YES");
		}	
	}
	if(b.size() != 3)
	{
		if(*(b.begin()) == 0 && b.size() == 1)
		{
			answer("YES");
		}
		else 
			answer("NO");
	}
	int u[3];
	int i = 0;
	for(auto y : b)
	{
		u[i] = y;
		i++;
	}
	if((u[0] ^ u[1]) != u[2])
	{
		answer("NO");
	}
	printv(u)
	if((u[1] ^ u[2] )!= u[0])
	{
		answer("NO");
	}
	if((u[2] ^ u[0]) != u[1])
		answer("NO");
	for(auto y : b)
	{
		if(a.count(y) != n / 3)
			answer("NO");
	}
	answer("YES");
}