from typing import List def is_bipartite(G: List[List[int]]): n = len(G) C = [-1] * n for s in range(n): if C[s] != -1: continue C[s] = 0 Q = [s] for u in Q: for v in G[u]: if C[v] == -1: C[v] = C[u] ^ 1 Q.append(v) elif C[v] == C[u]: return False return True n, m = map(int, input().split()) G = [[] for _ in range(n)] for _ in range(m): u, v = map(int, input().split()) G[u].append(v) G[v].append(u) if is_bipartite(G): print("Yes") else: print("No")