Today, Terry and Jake are analyzing X - factor of a group of n people (from 1 to n). Among these n people there exists m friendship relations of two people each (bidirectional). Now Terry told Jake that there are further groups of people which are good. A group is called good if every people in the group are friends with each other directly or indirectly, which means if 1 is friend of 2 and 2 is friend of 3, so 1 and 3 are also friends.
Now degree of a good group is measured by the person’s number which has most number of friendship relations in the group (if multiple such persons exist, person with least number is choosen as the degree of the group). Let there be K number of good groups, so Terry gives Jake a task to find P which is the sum of the degree of K good groups and calculate the X - factor of the whole group, P.K-1 modulo 109 + 7 where K-1 denotes the multiplicative inverse of K modulo 109+7. Since Jake is very lazy so he needs your help to solve this task.
Input:
The first line contains a single integer T - no. of test cases. The description of T test cases follows.
First line of each test case contains two integers n, m - the number of people and number
of friendship relations.
Next m lines contains two integers u, v - pair of people who are friends with each other
(friendship between two people does not occur more than once in the input).
Output:
For each test case, print a single line containing one integer - P.K-1 modulo 109 + 7.
Constraints:
1 ≤ T ≤ 10
1 ≤ n ≤ 20, 000
0 ≤ m ≤ 20, 000
1 ≤ u, v ≤ n
In first test case, degrees of three good groups are 1, 3 and 6. Therefore, P is 10 and K is 3.
In second case, degrees of two games are 1 and 7.