n, m = map(int, input().split()) edges = [[] for _ in range(n)] for _ in range(m): u, v = map(int, input().split()) u -= 1 v -= 1 edges[u].append(v) edges[v].append(u) stack = [u] used = [False] * n used[u] = True while stack: pos = stack.pop() for npos in edges[pos]: if used[npos]: continue used[npos] = True stack.append(npos) odd = 0 for i in range(n): if not used[npos] and edges[npos]: print("NO") exit() if len(edges[npos]) & 1: odd += 1 if odd <= 2: print("YES") else: print("NO")