#include <bits/stdc++.h>
using namespace std;
#define ll long long

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	ll n;
	cin>>n;
	ll arr[n] = {0};
	for(ll i=0;i<n;i++){
		cin>>arr[i];
	}
	ll flag = 0;
	for(ll i=0;i<n;i++){
		if(i==0){
			// cout<< (arr[i+1]^arr[n-1] )<<endl;
			if((arr[i+1]^arr[n-1]) != arr[i]){
				flag = 1;
				cout<<"No"<<endl; 
				break;
			} 
		}
		else if(i==n-1){
			if((arr[i-1]^arr[0]) != arr[i]){
				flag = 1; 
				cout<<"No"<<endl;
				break;
			}
		}
		else{
			if((arr[i-1]^arr[i+1]) != arr[i]){
				flag = 1;
				cout<<"No"<<endl;
				break;
			} 
		}
	}
	if(flag == 0) cout<<"Yes"<<endl;
    return 0;
}
