Fn.java
import java.io.*;
public class Fn{
static int noNodes;
static int noLines;
static int[] nodes; //deg of nodes
while((line = reader.readLine()) != null){
answer = "NO";
input = line.split(" ");
noNodes
= Integer.
parseInt(input
[0]); noLines
= Integer.
parseInt(input
[1]); nodes = new int[noNodes];
for(int i = 0; i<noLines; i++){
input = reader.readLine().split(" ");
}
}
}
static void insertNode(int a, int b){
nodes[a-1]++;
nodes[b-1]++;
if(nodes[a-1] == 4){
answer = "YES";
}
if(nodes[b-1] == 4){
answer = "YES";
}
}
}