class unif: def __init__(self,n): self.pare=[-1]*n self.size=[1]*n def root(self,x): while self.pare[x]!=-1: x=self.pare[x] return x def unite(self,u,v): rootu=self.root(u) rootv=self.root(v) if rootu!=rootv: if self.size[rootu]>=self.size[rootv]: self.pare[rootv]=rootu self.size[rootu]+=self.size[rootv] else: self.pare[rootu]=rootv self.size[rootv]+=self.size[rootu] def same(self,s,t): return self.root(s)==self.root(t) N,M=map(int,input().split()) G=[[] for i in range(N)] for i in range(M): a,b=map(int,input().split()) a-=1 b-=1 G[a].append(b) G[b].append(a) dist=[-1]*N from collections import deque for i in range(N): if dist[i]>=0: continue S=deque() S.append(i) dist[i]=0 while S: x=S.pop() for y in G[x]: if dist[y]==-1: dist[y]=dist[x]+1 dist[y]%=2 S.append(y) else: if dist[y]==dist[x]: print('No') exit() print('Yes')