#yuki1563 for i in range(int(input())): n,m=map(int,input().split()) for j in range(m): input() if n==1: print('No') else: print('Yes')