package main import "fmt" type point struct { x, y int } func check(here, from point) bool { return here.x == from.x && here.y == from.y } func main() { var n int fmt.Scan(&n) from := make([]point, n) to := make([]point, n) for i := range from { fmt.Scan(&from[i].x, &from[i].y) fmt.Scan(&to[i].x, &to[i].y) } a, b, c := point{2, 8}, point{3, 9}, point{7, 9} ta, tb, tc := point{5, 8}, point{4, 8}, point{6, 8} for i := range from { if check(a, from[i]) { a.x = to[i].x a.y = to[i].y } else if check(b, from[i]) { b.x = to[i].x b.y = to[i].y } else if check(c, from[i]) { c.x = to[i].x c.y = to[i].y } } if check(a, ta) && check(b, tb) && check(c, tc) { fmt.Println("YES") } else { fmt.Println("NO") } }