let () = let n = Scanf.scanf "%d\n" @@ fun n -> n in let koma = [|(2, 8); (3, 9); (7, 9)|] in for i = 0 to n-1 do Scanf.scanf "%d %d %d %d\n" @@ fun x1 y1 x2 y2 -> for i = 0 to 2 do if koma.(i) = (x1, y1) then koma.(i) <- (x2, y2) done; done; print_endline (if koma.(0) = (5,8) && koma.(1) = (4, 8) && koma.(2) = (6,8) then "YES" else "NO")