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

N,Q=map(int,raw_input().split())
arr=[]
for x in xrange(Q):
    i,j=map(int, raw_input().split())
    if i > j:
        i,j=j,i
    if i==j:
        print('NO')
        continue
    for r in arr:
        if ( r[0]<=j and r[1]>=j and r[0]>=i) or ( r[0]<=i and r[1]>=i and r[1]<=j ):
            #print(arr)
            print 'NO'
            break
    else:
        #print(arr)
        arr.append((i,j))
        print 'YES'