program abc(input,output);
var n,i,j,k,o :integer;
a:array [1..10,1..6] of integer;
begin
assign(input, 'C.in');
assign(output, 'C.out');
reset (input);
rewrite (output);
readln(input,n);
for i:=1 to n do
begin
for j:=1 to 6 do
read(input,a[i,j]);
readln(input);
end;
for I:=1 to n do
begin
o:=0;
if (a[i,2]=a[i,4]) or (a[i,4]=a[i,6]) or (a[i,2]=a[i,6])  then begin inc(o); writeln(output,'yes'); end
else if (a[i,1]=a[i,3]) or (a[i,3]=a[i,5]) or (a[i,1]=a[i,5]) then begin inc(o); writeln(output,'yes'); end;
if o=0 then writeln( output,'no');
end;
readln;
close (input);
close (output);
end.