#include <bits/stdc++.h>
#define ll long long 
#define rep(n,i) for (int (i)=0;(i)<(n);(i)++)
#define repi(n,k,i) for (int (i)=(k);(i)<(n);(i)++)
#define inrep(n,i) for (int (i)=(n)-1;(i)<0;(i)--)
#define pb push_back
#define vcs(x) x.begin(),x.end()
#define sz(x) x.size()
using namespace std;
int arr[100005];
main (){
	int gg=false;
	int n; cin>>n;
	rep(n,i) cin>>arr[i];
	rep(n,i){
		if (i==0) {
			if ((arr[1]^arr[n-1])!=arr[0]) gg=true;
			else continue;
		}
		if (i==n-1) {
			if ((arr[i-1]^arr[0])!=arr[i]) gg=true;
			else continue;
		}
		if (arr[i]!=(arr[i-1]^arr[i+1])) {
			gg=true;
		}
	}
	if (!gg) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
}