#!/usr/bin/ python3.8 import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines import itertools N, M = map(int, readline().split()) m = map(int, read().split()) AB = tuple(zip(m, m)) graph = [[] for _ in range(N + 1)] for a, b in AB: graph[a].append(b) graph[b].append(a) dist_1 = set(graph[1]) parent = [set() for _ in range(N + 1)] for u in dist_1: for v in graph[u]: if u == 1: continue parent[v].add(u) def solve(): for v1, v2 in AB: if v1 == 1 or v2 == 1: continue for u1, u2 in itertools.product(parent[v1], parent[v2]): if u1 == v2: continue if u2 == v1: continue if u1 == u2: continue print(v1, v2, u1, u2) return True return False print('YES' if solve() else 'NO')