Problem: Developer Petr thinks that he invented a perpetual motion machine. Namely, he has a lot of elements, which work in the following way.

Each element has one controller that can be set to any non-negative real value. If a controller is set on some value x, then the controller consumes x2 energy units per second. At the same time, any two elements connected by a wire produce y·z energy units per second, where y and z are the values set on their controllers.

Petr has only a limited number of wires, so he has already built some scheme of elements and wires, and is now interested if it's possible to set the controllers in such a way that the system produces at least as much power as it consumes, and at least one controller is set on the value different from 0. Help him check this, and if it's possible, find the required integer values that should be set.

It is guaranteed that if there exist controllers' settings satisfying the above conditions, then there exist required integer values not greater than 106.

Input

There are several (at least one) test cases in the input. The first line contains single integer — the number of test cases.

There is an empty line before each test case. The first line of test case contains two integers n and m (1 ≤ n ≤ 105, 0 ≤ m ≤ 105) — the number of elements in the scheme and the number of wires.

After that, m lines follow, each of them contains two integers a and b (1 ≤ a, b ≤ n) — two elements connected by a wire. No element is connected with itself, no two elements are connected by more than one wire.

It is guaranteed that the sum of n and the sum of m over all test cases do not exceed 105.

For hacks you can only use tests with one test case.

Output

Print answer for each test case.

For each test case print "YES" if it's possible to set the controllers in such a way that the consumed power is not greater than the power produced, and the required values on the next line. The settings should be integers from 0 to 106, inclusive, and at least one value should be different from 0. If there are multiple answers, print any of them.

If it's not possible to set the controllers in the required way, print one line "NO".

Example

Input

4
 
4 4
1 2
2 3
3 4
4 2
 
3 2
2 3
3 1
 
4 6
1 2
3 4
4 2
1 4
1 3
3 2
 
10 9
2 1
3 2
5 2
6 2
2 7
2 8
2 9
2 10
4 2


Output

YES
1 2 2 1
NO
YES
1 1 1 1
YES
1 5 1 1 1 1 1 1 1 1

Note

In the first example it's possible to set the controllers in the required way, for example, in the following way: set 1 on the first element, set 2 on the second and on the third, set 1 on the fourth. The consumed power is then equal to 12 + 22 + 22 + 12 = 10 energy units per second, the produced power is equal to 1·2 + 2·2 + 2·1 + 2·1 = 10 energy units per second. Thus the answer is "YES".

In the second test case it's not possible to set the controllers in the required way. For example, if we set all controllers to 0.5, then the consumed powers equals 0.75 energy units per second, while produced power equals 0.5 energy units per second.

Solution (in JAVA):

Solution:
import java.io.*;
import java.util.*;

public class Codeforces830E {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter pw = new PrintWriter(System.out);
		String[] sp = br.readLine().split(" ");
		int t = Integer.parseInt(sp[0]);
		for (int i = 0; i < t; i++) {
			sp = br.readLine().split(" ");
			sp = br.readLine().split(" ");
			int n = Integer.parseInt(sp[0]);
			int m = Integer.parseInt(sp[1]);
			int[] answer = new int[n];
			int[][] list = new int[m][2];
			for (int j = 0; j < m; j++) {
				sp = br.readLine().split(" ");
				list[j][0] = Math.min(Integer.parseInt(sp[0]), Integer.parseInt(sp[1]))-1;
				list[j][1] = Math.max(Integer.parseInt(sp[0]), Integer.parseInt(sp[1]))-1;
			}
			int[][] adjacency = toadjacency(list, n);
			boolean[] found = new boolean[n];
			int[] indexList = new int[n];
			int[] pointer = new int[n];
			int val = 0;
			int start = 0;
			int end = 1;
			while (val < n) {
				found[val] = true;
				pointer[val] = val;
				indexList[start] = val;
				end = start+1;
				while ((start < end) && (end < n)) {
					for (int j = 0; j < adjacency[indexList[start]].length; j++) {
						if (found[adjacency[indexList[start]][j]] == false) {
							found[adjacency[indexList[start]][j]] = true;
							indexList[end] = adjacency[indexList[start]][j];
							pointer[adjacency[indexList[start]][j]] = indexList[start];
							end++;
						}
					}
					start++;
				}
				while ((val < n) && found[val])
					val++;
			}
			int ind = -1;
			for (int j = 0; j < m; j++) {
				if (!(pointer[list[j][0]] == list[j][1]) && !(pointer[list[j][1]] == list[j][0]))
					ind = j;
			}
			if (ind >= 0) {
				pw.println("YES");
				int[] alist = new int[n];
				alist[0] = list[ind][0];
				int[] blist = new int[n];
				blist[0] = list[ind][1];
				int c1 = 0;
				int c2 = 0;
				for (c1 = 0; pointer[alist[c1]] != alist[c1]; c1++) {
					alist[c1+1] = pointer[alist[c1]];
				}
				for (c2 = 0; pointer[blist[c2]] != blist[c2]; c2++) {
					blist[c2+1] = pointer[blist[c2]];
				}
				while (alist[c1] == blist[c2]) {
					c1--;
					c2--;
				}
				for (int j = c1; j >= 0; j--) {
					answer[alist[j]] = 1;
					answer[alist[j+1]] = 1;
				}
				for (int j = c2; j >= 0; j--) {
					answer[blist[j]] = 1;
					answer[blist[j+1]] = 1;
				}
				for (int j = 0; j < n; j++)
					pw.println(answer[j]);
			}
			else {
				boolean bool1 = true;
				for (int j = 0; j < n; j++) {
					if (bool1 && (adjacency[j].length >= 4)) {
						answer[j] = 2;
						answer[adjacency[j][0]] = 1;
						answer[adjacency[j][1]] = 1;
						answer[adjacency[j][2]] = 1;
						answer[adjacency[j][3]] = 1;
						bool1 = false;
					}
				}
				if (!bool1) {
					pw.println("YES");
					for (int j = 0; j < n; j++)
						pw.println(answer[j]);
				}
				if (bool1) {
					boolean bool2 = true;
					for (int j = 0; j < n; j++) {
						if (bool2 && (adjacency[j].length == 3)) {
							int j1 = adjacency[j][0];
							int j2 = adjacency[j][1];
							int j3 = adjacency[j][2];
							if (adjacency[j1].length == 3) {
								for (int k = 0; k < 3; k++) {
									answer[adjacency[j1][k]] = 1;
								}
								answer[j] = 2;
								answer[j1] = 2;
								answer[j2] = 1;
								answer[j3] = 1;
								bool2 = false;
								pw.println("YES");
								for (int k = 0; k < n; k++)
									pw.println(answer[k]);
							}
							else if (adjacency[j2].length == 3) {
								for (int k = 0; k < 3; k++) {
									answer[adjacency[j2][k]] = 1;
								}
								answer[j] = 2;
								answer[j2] = 2;
								answer[j1] = 1;
								answer[j3] = 1;
								bool2 = false;
								pw.println("YES");
								for (int k = 0; k < n; k++)
									pw.println(answer[k]);
							}
							else if (adjacency[j3].length == 3) {
								for (int k = 0; k < 3; k++) {
									answer[adjacency[j3][k]] = 1;
								}
								answer[j] = 2;
								answer[j3] = 2;
								answer[j1] = 1;
								answer[j2] = 1;
								bool2 = false;
								pw.println("YES");
								for (int k = 0; k < n; k++)
									pw.println(answer[k]);
							}
							else {
								int j1length = 1;
								int k1 = j1;
								int l1 = j;
								while (adjacency[k1].length == 2) {
									j1length++;
									if (adjacency[k1][0] == l1) {
										l1 = k1;
										k1 = adjacency[k1][1];
									}
									else {
										l1 = k1;
										k1 = adjacency[k1][0];
									}
								}
								int j2length = 1;
								int k2 = j2;
								int l2 = j;
								while (adjacency[k2].length == 2) {
									j2length++;
									if (adjacency[k2][0] == l2) {
										l2 = k2;
										k2 = adjacency[k2][1];
									}
									else {
										l2 = k2;
										k2 = adjacency[k2][0];
									}
								}
								int j3length = 1;
								int k3 = j3;
								int l3 = j;
								while (adjacency[k3].length == 2) {
									j3length++;
									if (adjacency[k3][0] == l3) {
										l3 = k3;
										k3 = adjacency[k3][1];
									}
									else {
										l3 = k3;
										k3 = adjacency[k3][0];
									}
								}
								if (j1length < j2length) {
									int temp = j1;
									j1 = j2;
									j2 = temp;
									temp = j1length;
									j1length = j2length;
									j2length = temp;
									temp = k1;
									k1 = k2;
									k2 = temp;
								}
								if (j2length < j3length) {
									int temp = j2;
									j2 = j3;
									j3 = temp;
									temp = j2length;
									j2length = j3length;
									j3length = temp;
									temp = k2;
									k2 = k3;
									k3 = temp;
								}
								if (j1length < j2length) {
									int temp = j1;
									j1 = j2;
									j2 = temp;
									temp = j1length;
									j1length = j2length;
									j2length = temp;
									temp = k1;
									k1 = k2;
									k2 = temp;
								}
								if ((j1length >= 2) && (j2length >= 2) && (j3length >= 2)) {
									for (int k = 0; k < 2; k++) {
										answer[adjacency[j1][k]] = 1;
										answer[adjacency[j2][k]] = 1;
										answer[adjacency[j3][k]] = 1;
									}
									answer[j] = 3;
									answer[j1] = 2;
									answer[j2] = 2;
									answer[j3] = 2;
									bool2 = false;
									pw.println("YES");
									for (int k = 0; k < n; k++)
										pw.println(answer[k]);
								}
								else if ((j1length >= 3) && (j2length >= 3)) {
									int s1 = 0;
									int s2 = 0;
									int t1 = 0;
									int t2 = 0;
									if (adjacency[j1][0] == j)
										s1 = adjacency[j1][1];
									else
										s1 = adjacency[j1][0];
									if (adjacency[s1][0] == j1)
										t1 = adjacency[s1][1];
									else
										t1 = adjacency[s1][0];
									if (adjacency[j2][0] == j)
										s2 = adjacency[j2][1];
									else
										s2 = adjacency[j2][0];
									if (adjacency[s2][0] == j2)
										t2 = adjacency[s2][1];
									else
										t2 = adjacency[s2][0];
									answer[j] = 4;
									answer[j1] = 3;
									answer[j2] = 3;
									answer[j3] = 2;
									answer[s1] = 2;
									answer[s2] = 2;
									answer[t1] = 1;
									answer[t2] = 1;
									bool2 = false;
									pw.println("YES");
									for (int k = 0; k < n; k++)
										pw.println(answer[k]);
								}
								else if ((j1length >= 5) && (j2length >= 2)) {
									int s1 = 0;
									int s2 = 0;
									int t1 = 0;
									int u1 = 0;
									int v1 = 0;
									if (adjacency[j1][0] == j)
										s1 = adjacency[j1][1];
									else
										s1 = adjacency[j1][0];
									if (adjacency[s1][0] == j1)
										t1 = adjacency[s1][1];
									else
										t1 = adjacency[s1][0];
									if (adjacency[t1][0] == s1)
										u1 = adjacency[t1][1];
									else
										u1 = adjacency[t1][0];
									if (adjacency[u1][0] == t1)
										v1 = adjacency[u1][1];
									else
										v1 = adjacency[u1][0];
									if (adjacency[j2][0] == j)
										s2 = adjacency[j2][1];
									else
										s2 = adjacency[j2][0];
									answer[j] = 6;
									answer[j1] = 5;
									answer[j2] = 4;
									answer[j3] = 3;
									answer[s2] = 2;
									answer[s1] = 4;
									answer[t1] = 3;
									answer[u1] = 2;
									answer[v1] = 1;
									bool2 = false;
									pw.println("YES");
									for (int k = 0; k < n; k++)
										pw.println(answer[k]);
								}
								else if (adjacency[k1].length == 3) {
									for (int k = 0; k < 3; k++) {
										answer[adjacency[k1][k]] = 1;
									}
									k1 = j1;
									l1 = j;
									while (adjacency[k1].length == 2) {
										if (adjacency[k1][0] == l1) {
											l1 = k1;
											k1 = adjacency[k1][1];
										}
										else {
											l1 = k1;
											k1 = adjacency[k1][0];
										}
										answer[k1] = 2;
									}
									answer[j] = 2;
									answer[j1] = 2;
									answer[j2] = 1;
									answer[j3] = 1;
									bool2 = false;
									pw.println("YES");
									for (int k = 0; k < n; k++)
										pw.println(answer[k]);
								}
								else if (adjacency[k2].length == 3) {
									for (int k = 0; k < 3; k++) {
										answer[adjacency[k2][k]] = 1;
									}
									k2 = j2;
									l2 = j;
									while (adjacency[k2].length == 2) {
										if (adjacency[k2][0] == l2) {
											l2 = k2;
											k2 = adjacency[k2][1];
										}
										else {
											l2 = k2;
											k2 = adjacency[k2][0];
										}
										answer[k2] = 2;
									}
									answer[j] = 2;
									answer[j1] = 1;
									answer[j2] = 2;
									answer[j3] = 1;
									bool2 = false;
									pw.println("YES");
									for (int k = 0; k < n; k++)
										pw.println(answer[k]);
								}
								
							}
							
						}
					}
					if (bool2)
						pw.println("NO");
				}
			}
		}	
		pw.close();
	}
	
	public static int[][] toadjacency(int[][] list, int v) {
		int[] counter = new int[v];
		int n = list.length;
		for (int i = 0; i < n; i++) {
			counter[list[i][0]]++;
			counter[list[i][1]]++;
		}
		int[][] adjacency = new int[v][];
		for (int i = 0; i < v; i++) {
			adjacency[i] = new int[counter[i]];
		}
		int[] counter2 = new int[v];
		for (int i = 0; i < n; i++) {
			adjacency[list[i][0]][counter2[list[i][0]]] = list[i][1];
			counter2[list[i][0]]++;
			adjacency[list[i][1]][counter2[list[i][1]]] = list[i][0];
			counter2[list[i][1]]++;
		}
		
		return adjacency;
	}
}