from collections import defaultdict, deque n, m = map(int, input().split()) edge = defaultdict(list) V = [0 for _ in range(n)] for _ in range(m): a, b = map(int, input().split()) a -= 1 b -= 1 edge[a].append(b) edge[b].append(a) V[a] += 1 V[b] += 1 Que = deque() seen = set() for i in range(n): if V[i] == 1: Que.append(i) while Que: curr = Que.popleft() seen.add(curr) for np in edge[curr]: V[np] -= 1 if V[np] == 0: seen.add(np) elif V[np] == 1: Que.append(np) if seen == set(range(n)): print("Yes") else: print("No")