T = int(input()) for t in range(T): N,M = map(int, input().split()) for i in range(M): input() print('No' if N == 1 else 'Yes')