Go Back
Installation of OS in New Computers (300)
Description

In a new laboratory all the computers are brand new and these are not having any operating system installed in them. So, again Cibin took the initiative to install them in all the computers, but there is a twist.

The computers are connected to form a network and no two computers connected directly should have same type of OS. For example, if computer 1 is directly connected to computer 3 then both shouldn’t have Windows but one should have Linux.

Now let us consider that there are N computers starting from 1 to N and C direct connections between them. We have to assume that the first computer will need Linux installed in it. If the above condition is possible then Cibin need to print yes otherwise he should print no.

Input

The first line of input contain an integer T denoting the number of test cases. For each test case, the first line contains N i.e the number of computers and C i.e the number of connections. The next C lines contains the connections. (Example: 1 3 , 2 4 etc)

Output

For each test case, output a single line containing yes or no.

Constraints

1 <= T <= 100
1 <= N <= 10^3
0 <= C <= 10^3

Example
Copy Input

Input:
3
4 4
1 3
1 4
2 3
2 4
4 6
1 2
1 3
1 4
2 3
2 4
3 4
5 6
1 3
1 4
1 5
2 3
2 4
2 5

Output:
yes
no
yes

Explanation

CASE 1:

CASE 2:
In this case, it is not possible to install different OS on adjacent computers.
CASE 3:

Single Round Match #05
3 hour contest



Announcement
Scoring will be 100-200-300.

Problem Tags
graphs

Supported by our Coding Partner