#!/usr/bin/env python3 # %% import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines # %% N, M = map(int, readline().split()) m = map(int, read().split()) AB = zip(m, m) # %% G = [[] for _ in range(N)] for a, b in AB: G[a].append(b) G[b].append(a) # %% deg = [len(x) for x in G] comp = [0] * N next_c = 1 for v in range(N): if deg[v] == 0 or comp[v]: continue comp[v] = next_c next_c += 1 stack = [v] while stack: v = stack.pop() for w in G[v]: if not comp[w]: comp[w] = comp[v] stack.append(w) # %% odd_pt_cnt = sum(x & 2 for x in deg) is_euler = odd_pt_cnt <= 2 and max(comp) <= 1 print('YES' if is_euler else 'NO')