#include <bits/stdc++.h>
#define pqdef priority_queue
#define ii pair<int,int>
#define st first
#define nd second
#define ll long long 
#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i=0;i<(n);++i)
#define FOR(i,a,b) for (int i=(a); i<=(b); ++i)
#define INF 0xFFFFFF
#define endl '\n'
#define bitctr(n) __builtin_popcount(n)//2 tabainindaki basasmak toplami
#define bitctrll(n) __builtin_popcountll(n)//long long 2 tabainindaki basasmak toplami
const double PI = acos(-1);//2*acos(0.0);
const int MAXX=1000000001;
const int maxInt = 2147483647;
using namespace std;
unsigned long long int n,cnt,xxor;
unsigned long long int arr[MAXX];
int main(){
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n;
	cnt = 0;
	FOR(i,1,n) cin >> arr[i];
	FOR(i,1,n){
		unsigned long long int alt = (i - 1);
		unsigned long long int ust = (i + 1);
		if(alt == 0) alt = n;
		if(ust > n) ust = 1;
		xxor = arr[alt] ^ arr[ust];
		if(xxor == arr[i]){
			++cnt;
		}
	}
	if(cnt == n) cout<<"Yes"<<endl;
	else cout<<"No"<<endl; 
	return 0;
}
