N = int(input()) a = [[0]*10 for _ in [0]*10] a[2][8] = 1 a[3][9] = 2 a[7][9] = 3 for _ in [0]*N: x1, y1, x2, y2 = map(int, input().split()) a[x2][y2], a[x1][y1] = a[x1][y1], 0 if a[5][8] == 1 and a[4][8] == 2 and a[6][8] == 3: print("YES") else: print("NO")