#include<bits/stdc++.h>
#define reg register
#define rep(i, a, b) for (reg int i = (a), i##end = (b); i <= i##end; ++i)
#define dep(i, a, b) for (reg int i = (a), i##end = (b); i >= i##end; --i)
using namespace std;
using ll = long long;

signed main() {
	ll n;
	cin>>n;
	vector<ll> p(n);
	rep(i, 0, n-1) {
		cin>>p[i];
	}
	vector<ll> q(n);
	ll a, b, c;
	vector<ll> f(n);
	rep(l, 0, n-1) {
		rep(j, 0, n-1) {
			if (l == j) continue;
			a = p[l];
			b = p[j];
			rep(i, 2, n-1+2) {
				c = a xor b;
				a = b;
				q[i % n] = b = c;
			}
			rep(i, 0, n-1) {
				f[i] = 0;
			}
			rep(i, 0, n-1) {
				rep(k, 0, n-1) {
					if ((f[k] == 0) && (q[i] == p[k])) {
						f[k] = 1;
						goto n2;
					}
				}
				goto next;
	n2:
				;
			}
			cout<<"Yes"<<endl;
			return 0;
	next:
			;
		}
	}
	cout<<"No"<<endl;
}