n,m = map(int, input().split()) path = [[] for _ in range(n)] for _ in range(m): a,b = map(int, input().split()) path[a-1].append(b-1) path[b-1].append(a-1) ans = "Yes" memo = [-1 for _ in range(n)] for i in range(n): if memo != -1: continue d = [i] memo[i] = 0 while d: j = d.pop() for k in path[j]: if memo[k] == -1: memo[k] = memo[j] ^ 1 d.append(k) elif memo[k] == memo[j]: ans = "No" print(ans)