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>
using namespace std;
vector<int> v[111111];
int n, m, s[111111], vis[111111], b[111111];
int l, p[111111], f, ans[111111];
void print() {
  f = 1;
  printf("YES\n");
  int i;
  for (i = 1; i < n; i = i + 1) printf("%d ", ans[i]);
  printf("%d\n", ans[n]);
}
void s4(int x) {
  int i;
  ans[x] = 2;
  for (i = 0; i < 4; i = i + 1) ans[v[x][i]] = 1;
  print();
}
void cyc(int x) {
  int i;
  i = l;
  while (p[i] != x) {
    ans[p[i]] = 1;
    i--;
  }
  ans[x] = 1;
  print();
}
void s3s3(int x) {
  int i, t;
  t = p[1];
  for (i = 0; i < 3; i = i + 1) ans[v[t][i]] = 1;
  t = x;
  for (i = 0; i < 3; i = i + 1) ans[v[t][i]] = 1;
  for (i = 1; i <= l; i = i + 1) ans[p[i]] = 2;
  print();
}
void sv(int x, int y, int z) {
  int i, t;
  t = y * z;
  for (i = 1; i <= y; i = i + 1) {
    ans[x] = t;
    x = p[x];
    t -= z;
  }
}
void s3_222(int u, int x, int y, int z) {
  ans[u] = 3;
  sv(x, 2, 1);
  sv(y, 2, 1);
  sv(z, 2, 1);
  print();
}
void s3_133(int u, int x, int y, int z) {
  ans[u] = 4;
  sv(x, 1, 2);
  sv(y, 3, 1);
  sv(z, 3, 1);
  print();
}
void s3_125(int u, int x, int y, int z) {
  ans[u] = 6;
  sv(x, 1, 3);
  sv(y, 2, 2);
  sv(z, 5, 1);
  print();
}
void dfs1(int u, int fa) {
  if (f) return;
  int i;
  vis[u] = 1;
  b[u] = 1;
  l++;
  p[l] = u;
  for (i = 0; i < s[u]; i = i + 1) {
    if (f) return;
    if (v[u][i] == fa) continue;
    if (b[v[u][i]]) {
      cyc(v[u][i]);
      return;
    }
    dfs1(v[u][i], u);
  }
  p[l] = 0;
  l--;
  b[u] = 0;
}
void dfs2(int u, int fa) {
  if (f) return;
  int i;
  vis[u] = 1;
  l++;
  p[l] = u;
  if (l > 1 && s[u] >= 3) {
    s3s3(u);
    return;
  }
  for (i = 0; i < s[u]; i = i + 1) {
    if (f) return;
    if (v[u][i] != fa) dfs2(v[u][i], u);
  }
  p[l] = 0;
  l--;
}
int dfs3(int u, int fa) {
  int i, x;
  p[u] = 0;
  x = 0;
  for (i = 0; i < s[u]; i = i + 1)
    if (v[u][i] != fa) {
      x = max(x, dfs3(v[u][i], u));
      p[u] = v[u][i];
    }
  return x + 1;
}
int main() {
  int T, i, j, x, y, z;
  scanf("%d", &T);
  while (T--) {
    scanf("%d%d", &n, &m);
    for (i = 0; i <= n; i = i + 1) {
      v[i].clear();
      s[i] = 0;
      vis[i] = 0;
      p[i] = 0;
      ans[i] = 0;
      b[i] = 0;
    }
    l = 0;
    f = 0;
    for (i = 1; i <= m; i = i + 1) {
      scanf("%d%d", &x, &y);
      v[x].push_back(y);
      v[y].push_back(x);
      s[x]++;
      s[y]++;
    }
    for (i = 1; i <= n && !f; i = i + 1)
      if (s[i] >= 4) s4(i);
    if (f) continue;
    for (i = 1; i <= n && !f; i = i + 1) {
      if (!vis[i]) dfs1(i, 0);
    }
    if (f) continue;
    for (i = 0; i <= n; i = i + 1) {
      vis[i] = 0;
      p[i] = 0;
      b[i] = 0;
    }
    l = 0;
    for (i = 1; i <= n && !f; i = i + 1) {
      if (!vis[i] && s[i] >= 3) dfs2(i, 0);
    }
    if (f) continue;
    for (i = 0; i <= n; i = i + 1) {
      vis[i] = 0;
      p[i] = 0;
      b[i] = 0;
    }
    l = 0;
    for (i = 1; i <= n && !f; i = i + 1) {
      if (s[i] >= 3) {
        x = dfs3(v[i][0], i);
        y = dfs3(v[i][1], i);
        z = dfs3(v[i][2], i);
        if (x > y) {
          swap(v[i][0], v[i][1]);
          swap(x, y);
        }
        if (y > z) {
          swap(v[i][1], v[i][2]);
          swap(y, z);
        }
        if (x > y) {
          swap(v[i][0], v[i][1]);
          swap(x, y);
        }
        if (x >= 2)
          s3_222(i, v[i][0], v[i][1], v[i][2]);
        else {
          if (y >= 3) s3_133(i, v[i][0], v[i][1], v[i][2]);
          if (y == 2 && z >= 5) s3_125(i, v[i][0], v[i][1], v[i][2]);
        }
      }
    }
    if (f) continue;
    printf("NO\n");
  }
  return 0;
}