eolymp
bolt
Try our new interface for solving problems
Problems

The intersection of two segments

The intersection of two segments

Determine whether two line segments intersect. \textbf{Onput} Eight numbers - the coordinates of the ends of two segments. All input data are integers not exceeding modulo \textbf{10000}. \OutputFile One line of "\textbf{YES}", if the segments intersect, and "\textbf{NO}" otherwise.
Time limit 1 second
Memory limit 64 MiB
Input example #1
5 1 2 6
1 1 7 8
Output example #1
YES