{$apptype console} type point = record x,y:integer; end; point2 = record x,y:real; end; var a1,a2,b1,b2:point; c:point2; d,da,db:int64; x1,y1,x2,y2: real; ta,tb: real; checkIntersection:integer; begin readln(a1.x, a1.y, a2.x, a2.y); readln(b1.x, b1.y, b2.x, b2.y); d :=(a1.x-a2.x)*(b2.y-b1.y) - (a1.y-a2.y)*(b2.x-b1.x); da:=(a1.x-b1.x)*(b2.y-b1.y) - (a1.y-b1.y)*(b2.x-b1.x); db:=(a1.x-a2.x)*(a1.y-b1.y) - (a1.y-a2.y)*(a1.x-b1.x); if d=0 then begin if ((a1.x-b1.x)*(b2.y-b1.y)=(a1.y-b1.y)*(b2.x-b1.x)) or ((a2.x-b1.x)*(b2.y-b1.y)=(a2.y-b1.y)*(b2.x-b1.x)) or ((b1.x-a1.x)*(a2.y-a1.y)=(b1.y-a1.y)*(a2.x-a1.x)) or ((b2.x-a1.x)*(a2.y-a1.y)=(b2.y-a1.y)*(a2.x-a1.x)) then checkIntersection:=0 else checkIntersection:=-1; end else begin ta:=da/d; tb:=db/d; if (0<=ta) and (ta<=1) and (0<=tb) and (tb<=1) then begin c.x:=a1.x+ta*(a2.x-a1.x); c.y:=a1.y+ta*(a2.y-a1.y); checkIntersection := 1 end else checkIntersection := -1; end; if checkIntersection=-1 then writeln('No'); if (checkIntersection=1) or (checkIntersection=0) then writeln('Yes'); if checkIntersection=1 then write(c.x:0:3, ',',c.y:0:3); readln; end.