from collections import Counter from scipy.sparse.csgraph import connected_components from scipy.sparse import csr_matrix N, M = map(int, input().split()) deg = [0] * N valid_stations = set() frm, to = [], [] for _ in range(M): a, b = map(int, input().split()) valid_stations.add(a) valid_stations.add(b) frm.append(a) to.append(b) deg[a] += 1 deg[b] += 1 # 連結判定 matr = csr_matrix(([1] * M, (frm, to)), shape=(N, N)) _, labels = connected_components(matr) ct = Counter(labels[list(valid_stations)]) if len(ct) > 1: print('NO') exit() # 一筆書き可能性判定 is_odd = 0 for x in deg: if x % 2: is_odd += 1 print('YES' if is_odd in (0, 2) else 'NO')