def dfs(v, c, p): ret = True color[v] = c for nv in G[v]: if nv==p: continue if color[nv]==c: return False if color[nv]==1-c: continue ret = dfs(nv, 1-c, v) if ret==False: return ret return ret import sys input = sys.stdin.readline N, M = map(int, input().split()) AB = [list(map(int, input().split())) for _ in range(M)] G = [[] for _ in range(N)] for a, b in AB: a-=1 b-=1 G[a].append(b) G[b].append(a) color = [-1 for _ in range(N)] for i in range(N): if color[i]!=-1: continue ret = dfs(i, 0, -1) if ret==False: print("No") exit() print("Yes")