In the future there will be many worlds, and inside each one people will be able to teleport from planet to planet. A teleporter is one-way: a link from planet to planet lets you travel from to , but not back.
For each world, decide whether there is any planet you could leave and then return to by taking a series of teleports.
Input
First line of input will be a single integer - the number of worlds.
The first line of each world contains two integers and - the number of planets and the number of teleporters.
Each of the next lines contains two integers and - a teleporter leading from planet to planet .
Planets are numbered to .
Output
For every world print a single line: yes if some planet can be left and returned to, and no otherwise.
Example
2 5 5 0 1 2 1 2 3 3 4 4 2 5 5 0 1 2 1 2 3 3 4 4 0
yes no
In the first world you can leave planet and come back to it by teleporting . The second world uses almost the same links, but the last one leads to planet instead of planet - and planet has no teleporter arriving at it, so nothing can ever get back.
Constraints
The sum of over all worlds does not exceed , and the sum of does not exceed
This problem was adapted, with permission, from Provera ciklusa, authored by Društvo matematičara Srbije and Fondacija Petlja.