import sys,collections sys.setrecursionlimit(10**7) def Is(): return [int(x) for x in sys.stdin.readline().split()] def Ss(): return sys.stdin.readline().split() def I(): return int(sys.stdin.readline()) def S(): return input() n,m = Is() mat = [[] for _ in range(n)] for _ in range(m): a,b = Is() mat[a].append(b) mat[b].append(a) visited = [False]*(n) def DFS(v,p): visited[v] = True for e in mat[v]: if visited[e] == False: DFS(e, v) DFS(0,0) odd = 0 for i,e in enumerate(mat): if len(e) > 0: if visited[i] == False: print("NO") exit() elif len(e) % 2 == 1: odd += 1 if odd <= 2: print("YES") else: print("NO")