N,M = map(int,input().split()) l = [[] for _ in range(N)] vis = [0 for _ in range(N)] for _ in range(M): Sa,Sb = map(int,input().split()) l[Sa].append(Sb) l[Sb].append(Sa) vis[Sa] += 1 vis[Sb] += 1 def dfs(x): if l[x] == []: return z = l[x][:] l[x] = [] for y in z: dfs(y) for i in range(N): if vis[i] > 0: dfs(i) break flg = True for i in range(N): if vis[i] > 0 and l[i] != []: flg = False break ans = "NO" if flg and [x%2 for x in vis].count(1) in [0,1,2]: ans = "YES" print(ans)