n,m=map(int,input().split()) graph=[[] for _ in range(n)] for _ in range(m): u,v=map(lambda x:int(x)-1,input().split()) graph[u].append(v) graph[v].append(u) color=[0]*n def bipartite(v,c): res=[0,0] color[v]=c if c==1:res[0]+=1 else:res[1]+=1 for nv in graph[v]: if color[nv]==c:return [-1,-1] elif color[nv]==-c:continue else: black,white=bipartite(nv,-c) if black==-1 or white==-1:return [-1,-1] res[0]+=black res[1]+=white return res print('Yes' if bipartite(0,1)!=[-1,-1] else 'No')