Problem
You have pictures of two sculptures. The sculptures consist of several solid metal spheres, and some rubber pipes connecting pairs of spheres. The pipes in each sculpture are connected in such a way that for any pair of spheres, there is exactly one path following a series of pipes (without repeating any) between those two spheres. All the spheres have the same radius, and all the pipes have the same length.
You suspect that the smaller of the two sculptures was actually created by simply removing some spheres and pipes from the larger one. You want to write a program to test if this is possible.
The input will contain several test cases. One sculpture is described by numbering the spheres consecutively from 1, and listing the pairs of spheres which are connected by pipes. The numbering is chosen independently for each sculpture.Input
Output
Limits
Small dataset
1 ≤ C ≤ 100
2 ≤ N ≤ 8
1 ≤ M < N
Large dataset
1 ≤ C ≤ 50
2 ≤ N ≤ 100
1 ≤ M < N
Sample
Input 
Output 
2

Case #1: NO

In the first case, the large sculpture has five spheres connected in a line, and the small sculpture has one sphere that has three other spheres connected to it. There's no way the smaller sculpture could have been made by removing things from the larger one.
In the second case, the small sculpture is four spheres connected in a line. These can match the larger sculpture's spheres in the order 2145.