import sys sys.setrecursionlimit(10 ** 8) N,M = map(int,input().split()) s = set() parent = [-1] * N def find(i): if parent[i] < 0:return i parent[i] = find(parent[i]) return parent[i] def unite(i,j): I = find(i) J = find(j) if I == J:return False parent[J] += parent[I] parent[I] = J return True memo = [0] * N t = -1 for _ in range(M): a,b = map(int,input().split()) memo[a] ^= 1 memo[b] ^= 1 s.add(a) s.add(b) unite(a,b) t = b S = sum(memo) if len(s) == -parent[find(t)] and S <= 2: print('YES') else: print('NO')