616 4
305 250
558 43
182 37
297 138 60 5
60 28
32 38
31 44
48 30
14 34 7 6
5 5
1 5
4 5
3 6
1 5
3 3
YES
YES
NO
NO
 YES
YES
YES
YES
NO
 NO
YES
NO
NO
NO
NO

def check(n,q):
	d=[]
	while q>0:
		(l,r)=raw_input().split()
		l=int(l)
		r=int(r)
		if len(d) == 0 and l!=r:
			print "YES"
			d.append((l,r))
		elif l==r:
			print "NO"
		else:
			flag=False
			for i in d:
				#print i,l,r
				if (((l>=i[0] and l<=i[1]) and (r>=i[1] or r<=i[0])) or ((l>=i[1] and l<=i[0]) and (r<=i[1] or r>=i[0])) or ((r>=i[0] and r<=i[1]) and (l>=i[1] or l<=i[0])) or ((r<=i[0] and r>=i[1]) and (l<=i[1] or l>=i[0]))):
					flag=False
					break
				else:
					flag=True
			if flag:
				print "YES"
				d.append((l,r))
			else:
				print "NO"
		q-=1
	
if __name__ == "__main__":
	(n,q)=raw_input().split()
	n=int(n)
	q=int(q)
	check(n,q)