n=int(input()) x=[2,8] y=[3,9] z=[7,9] for i in range(n): a,b,c,d=map(int,input().split()) if [a,b]==x: x=[c,d] elif [a,b]==y: y=[c,d] elif [a,b]==z: z=[c,d] print("Yes" if x==[5,8] and y==[4,8] and z==[6,8] else "No")