There is a sale in the market on clothes , so as usual N girls gathered there to grab great deals.But due to huge popularity of sale crowd has gone uncontrollable. You being head of management team of the mall has been assigned the task to make them form a queue so that everyone can shop turn-wise. Since queue is going to be very long and knowing that its gonna take time for their turn there are M pair of girls who want to stand together in the queue so that they can discuss their personal stuff meanwhile. Now you need to make them form a queue so that none of them gets disappointed.
INPUT:
First line of input contains T number of test-cases , first line of each test-case contains two elements N , M total number of girls and number of pair of girls who wants to stand together. Next M line will contain pair of integers x y , which mean in queue they either stand as x y or y x .
OUTPUT:
For each test-case in a new line output "NO" ( without quotes ) if there is no possible arrangement such that no one gets disappointed if such a arrangement is possible print "YES" ( without quotes ) .
Constraints:
1 ≤ T ≤ 10
N , M ≤ 10 ^ 5