from collections import deque N, M = map(int, input().split()) edges = [[] for _ in range(N)] for _ in range(M): a, b = map(lambda x: x - 1, map(int, input().split())) edges[a].append(b) edges[b].append(a) dist = [-1] * N dist[0] = 0 dq = deque() dq.append(0) while dq: now = dq.popleft() for nxt in edges[now]: if dist[nxt] == -1: dist[nxt] = dist[now] + 1 dq.append(nxt) else: if (dist[nxt] - dist[now]) % 2 == 0: exit(print("No")) print("Yes")