eolymp
bolt
Try our new interface for solving problems
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.

prb8350.gif

Input

First line contains one integer n – the number of targets. Each of the next n lines contains 4 integers xi1, yi1, xi2, yi2 (-10000xi1, yi1, xi2, yi210000) – 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.

Time limit 1 second
Memory limit 128 MiB
Input example #1
3
2 0 2 4
4 1 6 5
6 3 9 0
Output example #1
YES
Source 2018 Azerbaijan School Competition, II Stage, April 8, Problem C