N, M = map(int, input().split()) S = [True for _ in range(N)] C = [False for _ in range(N)] G = [[] for _ in range(N)] for _ in range(M): a, b = map(int, input().split()) S[a] = not(S[a]) S[b] = not(S[b]) G[a].append(b) G[b].append(a) C[a] = C[b] = True p = a count = 0 for i, s in enumerate(S): if not s: count += 1 p = i def dfs(g, p, visited): visited.append(p) for n in g[p]: if n not in visited: dfs(g, n, visited) visited = [] dfs(G, p, visited) print('YES' if count <= 2 and len(visited) == C.count(True) else 'NO')