
#include<bits/stdc++.h>
using namespace std;
bool notXOR(int a, int b, int c){
	if(bitset<8>(a) ^ bitset<8>(b) != bitset<8>(c)) return true;
	else return false;
}
int main(){
		int N; cin >> N;
		int a[N]; for(int i = 0;i < N;++i) cin >> a[i];
		sort(a, a + N);
		do{
			int status = 0;//0 for yes, 1 for no
			for(int i = 1;i < N - 1;++i){
				if(notXOR(a[i-1],a[i+1],a[i])){
					status = 1;
					break;
				}
			}
			if(notXOR(a[1],a[N-1],a[0])) status = 1;
			if(notXOR(a[0],a[N-2],a[N-1])) status = 1;
			if(status == 0) goto YES;
		}while(next_permutation(a, a + 3));
		cout << "No" << endl;
		return 0;

		YES: cout << "Yes" << endl;
		return 0;
		//cout << a[0] << a[1] << a[2] <<endl;
		//cout << notXOR(a[0],a[1],a[2]) << notXOR(a[0],a[2],a[1]) << notXOR(a[1],a[2],a[0]) << endl;
   //cout << 2^3 << endl;
}
