T=int(input()) for tests in range(T): N,M=map(int,input().split()) for i in range(M): x,y=map(int,input().split()) print("Yes")