n = int(input()) move = [] for _ in range(n): x1, y1, x2, y2 = map(int, input().split()) move.append([[x1, y1], [x2, y2]]) pos = [[2, 8], [3, 9], [7, 9]] for frm, to in move: for i, e in enumerate(pos): if e == frm: pos[i] = to muteki = [[5, 8], [4, 8], [6, 8]] if pos == muteki: ans = "YES" else: ans = "NO" print(ans)