#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#define f first
#define s second
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define debug(v) cout << #v << ":\t" << v << endl
#define _ << " " <<

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll; 

const ll N = 1e5 + 3;
const ll INF = 1e9 + 7;

ll n, a[N], last, cur;
bool used[N];

int main() {
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
//	freopen("in", "r", stdin);
	
	cin >> n;
	for (ll i = 1; i <= n; ++i) cin >> a[i];
	
	sort(a+1, a+1 + n);
	
	last = 1;
	for (ll i = 2; i <= n; ++i) {
		ll x = a[1] ^ a[i];
		if (binary_search(a+1, a+1 + n, x)) {
			ll id = lower_bound(a+1, a+1 + n, x) - a;
			while (id == 1 || id == i) ++id;
			if (a[id] == x) {
				cur = id;
				goto lap;
			}
		}
	}
	cout << "No";
	return 0;
	lap:;
	
	used[last] = used[cur] = true;
	while (true) {
		ll x = a[last] ^ a[cur];
		if (binary_search(a+1, a+1 + n, x)) {
			ll id = lower_bound(a+1, a+1 + n, x) - a;
			while (id <= n && (used[id] || id == last || id == cur)) ++id;
			if (id > n) break;
			if (a[id] == x) {
				cur = id;
				goto lap;
			}
			else {
				cout << "No";
				return 0;
			}
		}
		else {
			cout << "No";
			return 0;
		}
		last = cur;
		cur = x;
	}
	
	for (ll i = 1; i <= n; ++i) {
		if (!used[i]) {
			cout << "No";
			return 0;
		}
	}
	cout << "Yes";
	
	return 0;
}
