from collections import deque N, M = map(int, input().split()) G = [[] for _ in range(N)] for _ in range(M): a, b = map(int, input().split()) G[a-1].append(b-1) G[b-1].append(a-1) def bfs(n): visited[n] = 0 que = deque() que.append(n) while que: n = que.popleft() for v in G[n]: if visited[v] == -1: visited[v] = visited[n]^1 que.append(v) elif visited[v] == visited[n]: exit(print("No")) visited = [-1]*N for i in range(N): if visited[i] == -1: bfs(i) print("Yes")