import sys input = sys.stdin.readline N,M=list(map(int,input().split())) E=[set() for i in range(N)] for i in range(M): x,y=list(map(int,input().split())) x-=1 y-=1 E[x].add(y) E[y].add(x) ANS=[0]*N ANS2=[[0]*5 for i in range(N)] ANS[0]=1 x=list(E[0])[0] ANS[x]=2 for to in E[0]: if to in E[0] and to in E[x]: y=to break ANS[y]=3 Q=[0,x,y] while Q: x=Q.pop() for to in E[x]: if ANS[to]==1: continue ANS2[to][ANS[x]]=1 if ANS[to]==0 and sum(ANS2[to])==3: for i in range(1,5): if ANS2[to][i]==0: color=i ANS[to]=color Q.append(to) print("Yes") print(*ANS)