package main import . "fmt" func main() { var n int Scan(&n) m:=map[string]string{} for ;n>0;n-- { var x1,y1,x2,y2 string Scan(&x1,&y1,&x2,&y2) k1:=x1+","+y1 k2:=x2+","+y2 e:=m[k1] if e=="" { e=k1 } m[k1]="" m[k2]=e } r:=m["5,8"]=="2,8"&& m["4,8"]=="3,9"&& m["6,8"]=="7,9" if r { Println("YES") } else { Println("NO") } }