{
Written by Fyodor Menshikov 12.02.2004
12:16-12:32
}
{$S-}
const
   maxn=100;
type
   integer=longint;
   point=record
      x,y:integer;
   end;
   segment=record
      p1,p2:point;
   end;
   line=record
      a,b,c:integer;
   end;

   procedure readPoint(var p:point);
   begin
      read(p.x,p.y);
   end;

   procedure readSegment(var s:segment);
   begin
      readPoint(s.p1);
      readPoint(s.p2);
      readln;
   end;

   procedure points2line(p1,p2:point;var l:line);
   begin
      {(x-x1)/(x2-x1)=(y-y1)/(y2-y1)}
      {(x-x1)*(y2-y1)=(y-y1)*(x2-x1)}
      {(y2-y1)x+(x1-x2)y+y1*(x2-x1)+x1*(y1-y2)=0}
      l.a:=p2.y-p1.y;
      l.b:=p1.x-p2.x;
      l.c:=p1.y*(p2.x-p1.x)+p1.x*(p1.y-p2.y);
   end;

   function intersects(l:line;s:segment):boolean;
   var
      val1,val2:integer;
   begin
      val1:=l.a*s.p1.x+l.b*s.p1.y+l.c;
      val2:=l.a*s.p2.x+l.b*s.p2.y+l.c;
      intersects:=not((val1>0)and(val2>0)or(val1<0)and(val2<0));
   end;

var
   n,i,ip1,ip2:integer;
   segments:array[1..maxn]of segment;
   points:array[1..maxn*2]of point;
   l:line;
   intersectAll:boolean;
begin
//   assign(input,'input.txt');
   reset(input);
//   assign(output,'output.txt');
   rewrite(output);
   readln(n);
   for i:=1 to n do begin
      readSegment(segments[i]);
      points[i*2-1]:=segments[i].p1;
      points[i*2-0]:=segments[i].p2;
   end;
   for ip1:=1 to 2*n do
      for ip2:=1 to 2*n do
         if ip1<>ip2 then begin
            points2line(points[ip1],points[ip2],l);
            intersectAll:=true;
            for i:=1 to n do
               if not intersects(l,segments[i]) then begin
                  intersectAll:=false;
                  break;
               end;
            if intersectAll then begin
               writeln('YES');
               halt;
            end;
         end;
   writeln('NO');
end.