eolymp
bolt
Try our new interface for solving problems
Problems

Point on a segment

Point on a segment

Determine whether a given point belongs to a given segment.

Input

Six integers - the point coordinates and the coordinates of the beginning and end of the segment. All input values do not exceed 10000 by absolute value.

Output

Print "YES", if the point belongs to the segment, and "NO" otherwise.

Time limit 1 second
Memory limit 122.17 MiB
Input example #1
3 3 1 2 5 4
Output example #1
YES
Input example #2
3 3 1 2 5 3
Output example #2
NO