I Know the Winner#4247

I Know the Winner

1 second
256 megabytes
Very easy

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 to 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 , indicating the number of test cases. Each test case begins with two integer (1 \leq N \leq 10000), indicating the number of contestants and (0 \leq M \leq 10000), indicating the number of information I get. Then lines follow, each line contains two integers A_i and B_i (1 \leq A_i, B_i \leq N), indicating A_i will always beat B_i.

Output

For each test case, if I can make it, output "Yes", otherwise output "No".

Examples

Example 1

Loading
Loading