import sequtils,strutils type unionfindtree[I : static[int]] = array[I,int] proc find(U : unionfindtree; a : int, b :int): bool= var s = a t = b while s != U[s]: s = U[s] while t != U[t]: t = U[t] return s == t proc union(U : var unionfindtree; a : int ; b : int)= if U.find(a,b): return var s = a t = b t2 : int while s != U[s]: s = U[s] while t != U[t]: t2 = U[t] U[t] = s t = t2 U[t] = s proc root(U : unionfindtree, a :int):int= var s = a while s != U[s]: s = U[s] return s var N, M : int a, b : int ut : unionfindtree[501] cnt : array[501, int] m = -1 cntodd : int for i in 0..500: ut[i] = i (N, M) = stdin.readline.split.map(parseInt) for n in 1..M: (a, b) = stdin.readline.split.map(parseInt) ut.union(a, b) cnt[a] += 1 cnt[b] += 1 for i in 0.. 2: echo "NO" else: echo "YES"