N,M=map(int,input().split()) assert 1<=N<=10**5 assert 0<=M<=10**5 for i in range(M): A,B=map(int,input().split()) assert 1<=A