Chiaki has a graph consisting of n vertices and m edges. Each edge connects two vertices. After a short time of research, she has realized that the graph may represents a special graph -- the k-th order Chiaki Chain.
An ordinary chain is a graph consisting of a sequential (at least two) vertices. Each two adjacent vertices are connected by an edge. The k-th order Chiaki Chain looks slightly different. There are k sub-chains extended from the main chain from k different vertices. At the end of each sub-chain, there is a simple cycle with length 3,4,…,k+2. There is no useless vertices or edges in the k-th order Chiaki Chain.
Chiaki would like to know whether the graph represents the k-th order Chiaki Chain or not.
There are multiple test cases. The first line of the input contains an integer T, indicating the number of test cases. For each test case:
The first line contains three integers n, m and k (1≤n,m,k≤2×105) -- the number of vertices and the number of edges in the graph and the order of Chiaki Chain.
Then followed by m lines, each line contains two integers x_i and y_i (1≤x_i,y_i≤n) representing the vertices the i-th edge connected.
It is guaranteed that the sum of m in all test cases will not exceed 2×105.
For each test case, output "Yes" if the graph represents the k-th order Chiaki Chain, or "No" if not.