import collections def solve(N, M, data): count = collections.Counter() unionset = [] for d in data: count.update(d) d0s = None d1s = None for s in unionset: if d[0] in s: d0s = s elif d[1] in s: d1s = s if d0s == None and d1s == None: unionset.append(set([d[0], d[1]])) elif d0s != None and d1s == None: d0s.add(d[1]) elif d0s == None and d1s != None: d1s.add(d[0]) else: unionset.remove(d0s) unionset.remove(d1s) n = d0s.union(d1s) unionset.append(n) oddcount = 0 for val in count.values(): if val % 2 == 1: oddcount += 1 return "YES" if oddcount <= 2 and len(unionset) == 1 else "NO" if __name__ == '__main__': N, M = map(int, input().split()) d = [] for _ in range(0, M): d.append(list(map(int, input().split()))) print(solve(N, M, d))