import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.NoSuchElementException; class DJSet { int n; int[] upper; public DJSet(int n) { this.n=n; upper=new int[n]; Arrays.fill(upper, -1); } int root(int x) { return upper[x]<0?x:(upper[x]=root(upper[x])); } boolean equiv(int x,int y) { return root(x)==root(y); } void setUnion(int x,int y) { x=root(x);y=root(y); if(x==y) return; if (upper[x][] g,int[] col,boolean uni) { col[cur]=1; for (int dst:g[cur]) { if (!uni&&dst==par) continue; if ((!uni&&col[dst]!=0)&&(uni&&col[dst]==1)) { System.out.println("Yes"); System.exit(0); } if (col[dst]==0) dfs(dst,cur,g,col,uni); } col[cur]=2; } void run() { FastScanner sc=new FastScanner(); PrintWriter pw=new PrintWriter(System.out); int N=sc.nextInt(); int M=sc.nextInt(); ArrayList[] g=new ArrayList[N]; ArrayList[] g2=new ArrayList[N]; DJSet ds=new DJSet(N); int[] a=new int[M]; int[] b=new int[M]; int[] c=new int[M]; for (int i=0;i(); for (int i=0;i(); for (int i=0;i