unittest
{
	assert( [ "3", "1 2 3" ].parse.expand.solve == "Yes" );
	assert( [ "4", "1 2 4 8" ].parse.expand.solve == "No" );
}



import std.algorithm;
import std.conv;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	input.popFront;
	auto as = input.front.split.to!( long[] );
	return tuple( as );
}

auto solve( long[] as )
{
	as.sort();
	LOOP: do
	{
		for( auto i = 0L; i < as.length.signed - 3; i++ )
		{
			if( ( as[ i ] ^ as[ i + 1 ] ) == as[ i + 2 ] ) continue LOOP;
		}
		if( ( as[ $ - 2 ] ^ as[ $ - 1 ] ) == as[ 0 ] ) return "Yes";
	}
	while( as.nextPermutation );
	return "No";
}
