Monster Trap

Time limit1sMemory limit128 MB

Problem

Long ago, when people still believed in magic, there lived a great wizard named Aranyaka Gondlir. After twenty years of hard training deep in a forest, he finally mastered the ultimate magic and set out for home.

When he reached his home village, Aranyaka was shocked at how desolate it had become. A gloom hung over the village, and even the whisper of the wind frightened the villagers. It was but a shadow of what it had once been.

What had happened? He soon recognized the unmistakable sign of an evil, immortal monster. Even the great wizard could not kill it, so he resolved to seal it away with magic. Aranyaka could cast a spell to build a monster trap: once he drew a line on the ground with his magic rod, that line became a barrier wall no monster could cross. Because he could only draw straight lines, he had to draw several of them to complete a trap, that is, barrier walls that fully enclose the monster. If any gap remained between the walls, the monster could slip through it and escape.

For example, the barrier walls in the left figure form a complete monster trap with no gaps, where "M" marks the monster's position. The walls in the right figure, by contrast, have a loophole even though they are almost complete.

Your task is to write a program that decides whether the wizard has successfully sealed the monster.

Input

The input consists of multiple datasets, each in the following format.

n
x1 y1 x'1 y'1
x2 y2 x'2 y'2
    . . .
xn yn x'n y'n

The first line of a dataset contains a positive integer $n$, the number of line segments the wizard drew. Each of the next $n$ lines contains four integers $x$, $y$, $x'$, and $y'$, the coordinates of two points $(x, y)$ and $(x', y')$ joined by a line segment. Every line segment has non-zero length. You may assume that $n \le 100$ and that all coordinates are between $-50$ and $50$, inclusive.

For convenience, the coordinate system is arranged so that the monster is always at the origin $(0, 0)$, and the wizard never draws a line through $(0, 0)$.

You may assume that any two line segments have at most one intersection point, that no three line segments share the same intersection point, and that the distance between any two intersection points is greater than $10^{-5}$.

A line containing a single zero marks the end of the input.

Output

For each dataset, print "yes" or "no" on its own line. Print "yes" if the monster trap is complete, and "no" otherwise (that is, if there is a loophole).