A fly just travelled between two points in the plane, stopping at several windows (segments) on its way. The fly does not have a very big brain, but it is powerful enough to fly in a straight line between stops. Now the fly wants to go back and visit the windows in reverse order, but it is still worried about efficiency. Is the reverse path optimal? Please help the fly with your bigger brain.

**Input**

Input consists of several cases, which only have integer numbers.
Every case begins with the number of segments *n*.
Follow the description of the *s*_{1} …*s*_{n} segments,
in the order the fly visits them,
each with two pairs (*x*, *y*) with the coordinates of its two endpoints.
Follow *n*+2 pairs (*x*, *y*)
with the coordinates of the points *a*_{i}
where the fly stopped at the segments, in order.
The first pair is the initial position *a*_{0},
and the last pair is the final position *a*_{n+1}.

Assume 1 ≤ *n* ≤ 10^{4}.
Segments are different, and do not intersect.
The polygonal line *a*_{n+1} … *a*_{0} does not cross any segment.
For all 1 ≤ *i* ≤ *n*,
*a*_{i} is strictly inside the segment *s*_{i}.
The length of each window and flight segment
is strictly positive, and at most 1000.
No coordinate is larger than 10^{6} in absolute value.

**Output**

Print “`yes`” if the polygonal line *a*_{n+1} … *a*_{0}
is the shortest path between *a*_{n+1} and *a*_{0}
that visits the segments *s*_{n} … *s*_{1} in this order.
Print “`no`” otherwise.

**Hint**

All the required computations can be made
with `long longs` without overflows.

Public test cases

**Input**

1 500 0 500 100 0 0 500 50 0 100 1 500 0 500 100 0 0 500 50 0 50

**Output**

yes no

Information

- Author
- Marc Vinyals
- Language
- English
- Official solutions
- C++
- User solutions
- C++