from collections import deque n, m = map(int, input().split()) l = [-1] * n to = [[] for _ in range(n)] for _ in range(m): aa, bb = map(int, input().split()) aa -= 1 bb -= 1 to[aa].append(bb) to[bb].append(aa) for i in range(n): if l[i] != -1: continue l[i] = 0 q = deque([i]) while q: v = q.popleft() for u in to[v]: if l[u] != -1: if l[u] == l[v]: print("No") exit() continue l[u] = 1 - l[v] q.append(u) print("Yes")