I Know the Winner
Contest is beginning! After several hours, one of you will be the winner of this contest, and believe it or not, I know who it is!
But of course, I couldn‟t publish his name now, so let's consider another interesting knockout match first. In each round of this match, we choose two players who haven't been sifted out to have a match, the loser will be knocked out until exactly only one person left, and he is the winner.
As the host, No.1 is my friend's ID, I want him win the match, and what‟s more, I can arrange every round of this match, and I also get some information details: Ai always beats Bi. But too many information make me confused. Now I just want to know one thing, can I set the tournament up so that my friend is the winner definitely?
Input
The first line contains a single integer T, indicating the number of test cases. Each test case begins with two integer N(1 ≤ N ≤ 10000), indicating the number of contestants and M (0 ≤ M ≤ 10000), indicating the number of information I get. Then M lines follow, each line contains two integers A_i and B_i (1 ≤ A_i, B_i ≤ N), indicating A_i will always beats B_i.
Output
For each test case, if I can make it, output "Yes", otherwise output "No".