from collections import deque N,M = map(int,input().split()) G = {i:[] for i in range(N)} for _ in range(M): a,b = map(int,input().split()) G[a].append(b) G[b].append(a) C = {0:[],1:[]} for i in range(N): if len(G[i])==0:continue C[len(G[i])%2].append(i) if len(C[1])==0: visited = [0]*N s = C[0][0] visited[s] = 1 que = deque([s]) while que: i = que.popleft() for j in G[i]: if visited[j]==0: visited[j] = 1 que.append(j) if sum(visited)==len(C[0]): print("YES") else: print("NO") elif len(C[1])==2: s,g = C[1] visited = [0]*N visited[s] = 1 que = deque([s]) while que: i = que.popleft() for j in G[i]: if visited[j]==0: visited[j] = 1 que.append(j) if sum(visited)==len(C[0])+2: print("YES") else: print("NO") else: print("NO")