N,M=map(int,input().split()) z=[list(map(int,input().split())) for _ in range(M)] z=sorted(z) s='No' t0,p0=0,0 for t,p in z: if t-t0