import collections N,M = map(int,input().split()) lsg = [[] for i in range(N)] cntn = [0]*(N) eki = set() for i in range(M): a,b = map(int,input().split()) lsg[a].append(b) lsg[b].append(a) cntn[a] += 1 cntn[b] += 1 eki.add(a) eki.add(b) d = collections.deque([0]) used = [False]*N while d: v = d.popleft() if used[v]: continue used[v] = True for j in lsg[v]: if used[j]: continue d.append(j) if used.count(True) != len(eki): print('NO') exit() evencnt = 0 for i in eki: if cntn[i] % 2 == 1: evencnt += 1 if evencnt == 0 or evencnt == 2: print('YES') else: print('NO')