n,m = map(int,raw_input().split()) class UnionFind(): def __init__(self,size): self.table = [-1 for _ in range(size)] def find(self,x): while self.table[x] >= 0: x = self.table[x] return x def union(self,x,y): s1 = self.find(x) s2 = self.find(y) if s1 != s2: if self.table[s1] != self.table[s2]: if self.table[s1] < self.table[s2]: self.table[s2] = s1 else: self.table[s1] = s2 else: self.table[s1] += -1 self.table[s2] = s1 return degree = [0 for i in range(n)] uf = UnionFind(n) for i in range(m): f,t = map(int,raw_input().split()) degree[f] += 1; degree[t] += 1 uf.union(f,t) a = -1 for i in range(n): if degree[i] > 0: a = i break a = uf.find(a) count = 0 for i in range(n): if degree[i] != 0 and uf.find(i) == a: if degree[i] % 2 == 1: count += 1 elif degree[i] == 0: continue else: print 'NO' quit() if count == 0 or count == 2: print 'YES' else : print 'NO'