SP12978 SGAME - SHAPE GAME
Description
You probably might have played the game of constructing a figure without lifting up the pencil.But it seems too easy for us.
Let's add some twist to it!
What about start constructing a figure from a point and returning to the same point resulting in the figure without lifting up the pencil.
Note: Figure is bounded and one can't retrace an arc or line.
**INPUT SPECIFICATION**
Input consists of several test data.There are 't' test cases. For each case you are given the point index 'n' from which to start and end.Then follows two space separated index that define a line from index 'i' to index 'j'.These integers follow up until "-1 -1" is encountered.
**OUTPUT SPECIFICATION**
Output "YES", if it's possible to construct figure satisfying the specification and "NO" if it's not possible (without quotes).
**CONSTRAINTS**
t
Input Format
N/A
Output Format
N/A