import sys, time, random from collections import deque, Counter, defaultdict input = lambda: sys.stdin.readline().rstrip() ii = lambda: int(input()) mi = lambda: map(int, input().split()) li = lambda: list(mi()) inf = 2 ** 61 - 1 mod = 998244353 n, m = mi() graph = [[] for _ in range(n)] for _ in range(m): a, b = mi() graph[a - 1].append(b - 1) graph[b - 1].append(a - 1) # is bipartite color = [-1] * n def dfs(v, c): color[v] = c for u in graph[v]: if color[u] == -1: dfs(u, c ^ 1) elif color[u] == c: print('No') exit() dfs(0, 0) print('Yes')