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[p] = True for n in g[p]: if not visited[n]: dfs(g, n, visited) visited = [False for _ in range(N)] dfs(G, p, visited) print('YES' if count <= 2 and visited.count(True) == C.count(True) else 'NO')