Given a undirected graph and a Hamiltonian cycle of it, output whether it is a planar graph.
For convenience, the indices of vertex are advancely relabeled so that the given Hamiltonian cycle is 1--2--3--4--...--(n-1)--n--1. The edges on this cycle are not given in the input.
Notice that there might be self loops and multiedges in the graph.
There are T test cases in total.
输入解释
The first line contains one integer T – the number of test cases.
For each test case:
The first line, two positive integer N,M - the number of vertices and edge besides the Hamiltonian cycle. Following m lines, two positive integer x,y, representing an edge (x,y)
1 ≤ T ≤ 26 1 ≤ N,M ≤ 5×$10^5$ , $\sum N$,$ \sum M ≤ 3 \times 10^6$. 1 ≤ x,y ≤ N
输出解释
For each test case, output ”Yes” or ”No” in one line.