int main() {
	int number; cin >> number;
	int　anAray[number] = {};

	for(int i = 0; i < number; i++){
		cin >> anAray[i];
	}

	for(int j = 0; i < number; j++){
		if(j == 0){
			int checkNumber = anArray[j+1] ^ anArray[number-1];
			if(anArray[j] != checkNumber) {cout << "No" << endl;}
		}else if (j == number-1){
			int checkNumber = anArray[j-2] ^ anArray[j-1];
			if(anArray[j] != checkNumber) {cout << "No" << endl;}
		}else {
			int checkNumber = anArray[j-1] ^ anArray[j+1];
			if(anArray[j] != checkNumber) {cout << "No" << endl;}
		}
	}
	
	cout << "Yes" << endl;

	return 0;
}