n,m=map(int,input().split()) l=[[0,0]]+[list(map(int,input().split())) for _ in range(m)] for i in range(m): if abs(l[i+1][0]-l[i][0])