A classical problem in graph theory involves finding cliques. Consider an undirected graph with vertices. A clique is a complete subgraph - i.e., it is a set of nodes such that all possible edges between these nodes exist. This problem asks you if a clique exists in a given graph. To make things simple you are told that k = 4, i.e., you are looking for a clique of size .
The input will contain multiple instances. The first line of each instance has two integers - the number of nodes (n < 20) and the number of edges (m < 100). The second line has pairs of numbers each denoting an undirected edge. The nodes are labeled from to . You may assume there are no repeats in the edge list. The last line contains and should not be processed.
The output should contain one line for each case. Each line should have a YES or a NO, depending on whether there is a clique of size or not.
Beispiel 1