1808 Galaxy


Submit solution

Points: 100
Time limit: 1.0s
Memory limit: 32M

Problem types
Allowed languages
C, C++, Java, Python

Description

Galaxy is an Android Game. It's easy to play:

Just to link the stars in one stroke. It will give you several undirected line(s), you should pass them all and only once.

Input

This problem contains several cases. The first line of each case is an integer N (0 < N <= 500), indicates the number of lines. Then it follows N line(s). Each line contains 4 integers: The two coordinates of the undirected line. (-500 <= x1, y1, x2, y2 <= 500)

Output

For each case, if the galaxy can be linked by the rules above, print YES. Or print NO.

Sample

Input

2
1 2 3 4
3 4 5 6

Output

YES

Source: XadillaX


Comments

There are no comments at the moment.