import sys sys.setrecursionlimit(5*10**5) input = sys.stdin.readline from collections import defaultdict, deque, Counter from heapq import heappop, heappush from bisect import bisect_left, bisect_right from math import gcd n,m = map(int,input().split()) graph = [[] for i in range(n+1)] for i in range(m): u,v = map(int,input().split()) graph[u].append(v) graph[v].append(u) depth = [-1]*(n+1) def bfs(s, n): que = deque([s]) depth[s] = 0 ok = 1 while que: crr = que.popleft() for nxt in graph[crr]: if depth[nxt] == -1: depth[nxt] = depth[crr]^1 que.append(nxt) elif depth[nxt]^1 != depth[crr]: ok = 0 return ok ans = 1 for i in range(1,n+1): if depth[i] != -1: continue ans &= bfs(i, n) if ans: print('Yes') else: print('No')