Problems
Shooter
Shooter
The shooter needs to hit n targets, but he has only one bullet left. Determine whether he can find such a point (not necessarily with integer coordinates) and the direction of the shot that a bullet fired from this point in this direction will fly through all the targets.
Input
First line contains one integer n – the number of targets. Each of the next n lines contains 4 integers xi1
, yi1
, xi2
, yi2
(-10000 ≤ xi1
, yi1
, xi2
, yi2
≤ 10000) – the starting and the ending position of the i-th target (the targets are represented as disjoint segments on the plane).
Output
Print one line with a word YES if the solution exists and NO otherwise.
Input example #1
3 2 0 2 4 4 1 6 5 6 3 9 0
Output example #1
YES