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 CPP):

Solution:
#include <bits/stdc++.h>
int T, n, m, u, v, flag, a[200005], b[200005], leg[200005], fa[200005];
int father(int x) { return fa[x] == x ? x : fa[x] = father(fa[x]); }
std::vector<int> e[200005];
int d[200005], pre[200005], dep[200005], val[200005], rec[200005];
void dfs(int x) {
  for (int i = 1; i <= d[x]; i++) {
    int y = e[x][i - 1];
    if (y == pre[x]) continue;
    pre[y] = x;
    dep[y] = dep[x] + 1;
    dfs(y);
  }
}
void make(int u, int v, int t) {
  if (u == v)
    val[u] += t;
  else if (dep[u] > dep[v])
    val[u] += t, make(pre[u], v, t);
  else
    val[v] += t, make(u, pre[v], t);
}
int down(int fr, int x) {
  if (d[x] == 1) return 0;
  return down(x, e[x][0] + e[x][1] - fr) + 1;
}
void go(int fr, int x, int r, int t) {
  val[x] += r - t;
  if (r > t) go(x, e[x][0] + e[x][1] - fr, r - t, t);
}
int main() {
  scanf("%d", &T);
  while (T--) {
    scanf("%d%d", &n, &m);
    for (int i = 1; i <= m; i++) scanf("%d%d", &a[i], &b[i]), leg[i] = 0;
    for (int i = 1; i <= n; i++) fa[i] = i, e[i].clear(), d[i] = 0;
    flag = 0;
    for (int i = 1; i <= m; i++) {
      u = father(a[i]), v = father(b[i]);
      if (u == v) {
        u = a[i];
        v = b[i];
        flag = 1;
        break;
      };
      fa[u] = v;
      leg[i] = 1;
      e[a[i]].push_back(b[i]);
      d[a[i]]++;
      e[b[i]].push_back(a[i]);
      d[b[i]]++;
    }
    for (int i = 1; i <= n; i++) pre[i] = 0;
    for (int i = 1; i <= n; i++)
      if (!pre[i]) dep[i] = 0, dfs(i);
    for (int i = 1; i <= n; i++) val[i] = 0;
    if (flag)
      make(u, v, 1);
    else {
      for (int i = 1; i <= n; i++)
        if (d[i] >= 4) {
          u = v = i;
          flag = 1;
          break;
        }
      if (!flag) {
        for (int i = 1; i <= n; i++) rec[i] = 0;
        for (int i = 1; i <= n; i++)
          if (d[i] >= 3) {
            u = father(i);
            if (!rec[u])
              rec[u] = i;
            else {
              v = rec[u];
              u = i;
              flag = 1;
              break;
            }
          }
      }
      if (!flag) {
        int d1, d2, d3, w, s;
        for (int i = 1; i <= n; i++)
          if (d[i] == 3) {
            d1 = down(i, e[i][0]) + 1;
            d2 = down(i, e[i][1]) + 1;
            d3 = down(i, e[i][2]) + 1;
            if (d1 > 5) d1 = 5;
            if (d2 > 5) d2 = 5;
            if (d3 > 5) d3 = 5;
            w = 720, s = -w * w;
            s += w * w / (d1 + 1) * d1 / 2;
            s += w * w / (d2 + 1) * d2 / 2;
            s += w * w / (d3 + 1) * d3 / 2;
            if (s >= 0) {
              u = i;
              flag = 1;
              break;
            }
          }
        if (!flag) {
          puts("NO");
          continue;
        }
        val[u] = w;
        go(u, e[u][0], w, w / (d1 + 1));
        go(u, e[u][1], w, w / (d2 + 1));
        go(u, e[u][2], w, w / (d3 + 1));
      } else {
        make(u, v, 2);
        for (int i = 1; i <= d[u]; i++) {
          int y = e[u][i - 1];
          if (!val[y]) val[y]++;
        }
        for (int i = 1; i <= d[v]; i++) {
          int y = e[v][i - 1];
          if (!val[y]) val[y]++;
        }
      }
    }
    puts("YES");
    for (int i = 1; i <= n; i++) printf(i < n ? "%d " : "%d\n", val[i]);
  }
}