Maximal Clique
This is the moment you’ve been waiting for all your life: you’ve invented a way to quickly solve the Maximal Clique problem: given an undirected graph find the size of the maximal subset of its vertices that form a clique (are pairwise connected). This problem is NP-hard, meaning you’ve got a proof that P=NP!
Unfortunately, the scientific community is not so eager to listen to you. Your papers on the subject are being rejected because of "solving an obviously unsolvable problem". Your phone number is already on the ignore list of all Computer Science professors you know. The world seems to hate you.
So you’ve decided to create a solver for the Maximal Clique problem and put it online, so that everyone can check for himself that you’re right. You’ve already implemented the solver and almost launched the website, but then you’ve realized that this is not a very good idea: if you make the solver available, everyone will be able to solve every problem from NP by reducing it to the Maximal Clique problem. What if people will just silently use it instead of bringing you fame and respect?
Luckily, the only proof of NP-hardness of the Maximal Clique problem you know works by reducing the 3-SAT problem to it in a very specific way. So you’ve decided to check if the input graph given to your solver could be obtained from this reduction, and if yes, refuse to solve the problem. That way, nobody will be able to get quick solutions for all problems from NP, but everyone will still be able to verify your solver by feeding other graphs to it.
3-SAT problem statement is: given a formula of form , where each term t^i_j is either some boolean variable or its negation (more formally, either x_k or ¬x_k), check whether there exists some assignment of true/false values to each variable so that the formula evaluates to true. All three terms in one clause must represent different variables.
The reduction works in the following manner. From the above formula, we create a graph with 3n vertices, one for each variable of each clause. Two vertices corresponding to terms t^i_j and t^r_s are connected when i≠r (so the terms belong to different clauses) and those terms are non-contradictory (they are either equal or represent different variables).
The following picture shows the resulting graph for the formula (x_1∨x_2∨¬x_3)∧(¬x_1∨¬x_2∨x_4)∧(¬x_1∨¬x_2∨¬x_4):
Now a clique of size n corresponds to a valid true/false assignment that satisfies at least one term in each clause. The edges highlighted on the above picture form a clique of size 3 and show that setting x_1 to false and x_2 to true satisfies all clauses, irrespective of the values of x_3 and x_4.
Given a graph, you need to check if it could be created by the above reduction. The vertices are permuted arbitrarily.
Input
The first line of the input file contains two integers v (1 ≤ v ≤ 100) and e, denoting the number of vertices and edges in the graph. The next e lines contain two integers each, denoting the numbers of vertices connected by an edge. Each pair of vertices are connected at most once, no edge connects a vertex to itself.
Output
Output "YES" when the given graph could be obtained by the given reduction, or "NO" otherwise.