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;
int n, m;
int degree[100005];
int answer[100005];
int uf[100005];
int prt[100005];
int depth[100005];
int weight[100005];
vector<int> graph[100005];
vector<int> component_set;
int find(int a) {
  if (uf[a] == a) return a;
  return uf[a] = find(uf[a]);
}
void un(int a, int b) {
  a = find(a);
  b = find(b);
  uf[a] = b;
}
void dfs(int node, int parent, int dep) {
  component_set.push_back(node);
  prt[node] = parent;
  depth[node] = dep;
  weight[node] = 1;
  for (int i = 0; i < graph[node].size(); i++) {
    if (graph[node][i] != parent) {
      dfs(graph[node][i], node, dep + 1);
      weight[node] += weight[graph[node][i]];
    }
  }
}
void paint_route(int from, int to, int val) {
  if (depth[from] < depth[to]) {
    int t = from;
    from = to;
    to = t;
  }
  while (depth[from] > depth[to]) {
    answer[from] = val, from = prt[from];
  }
  while (from != to) {
    answer[from] = answer[to] = val;
    from = prt[from];
    to = prt[to];
  }
  answer[from] = val;
}
void answer_yes(void) {
  printf("YES\n");
  for (int i = 1; i <= n; i++) printf("%d ", answer[i]);
  printf("\n");
}
void paint_chain(int node, int parent, int val, int dec) {
  if (val <= 0) return;
  answer[node] = val;
  for (int i = 0; i < graph[node].size(); i++) {
    if (graph[node][i] != parent) {
      paint_chain(graph[node][i], node, val - dec, dec);
      return;
    }
  }
}
bool work_component(int component_root) {
  component_set.clear();
  dfs(component_root, 0, 0);
  vector<int> deg3;
  for (int ind = 0; ind < component_set.size(); ind++) {
    int node = component_set[ind];
    if (degree[node] >= 4) {
      answer[node] = 2;
      for (int i = 0; i < graph[node].size(); i++) {
        answer[graph[node][i]] = 1;
      }
      return true;
    } else if (degree[node] == 3) {
      deg3.push_back(node);
    }
  }
  if (deg3.size() == 0) {
    return false;
  } else if (deg3.size() >= 2) {
    for (int i = 0; i < 3; i++) {
      answer[graph[deg3[0]][i]] = 1;
      answer[graph[deg3[1]][i]] = 1;
    }
    paint_route(deg3[0], deg3[1], 2);
    return true;
  } else {
    int central = deg3[0];
    dfs(central, 0, 0);
    pair<int, int> wts[3];
    for (int i = 0; i < 3; i++) {
      wts[i] = make_pair(weight[graph[central][i]], graph[central][i]);
    }
    sort(wts, wts + 3);
    if (wts[0].first >= 2) {
      answer[central] = 3;
      paint_chain(wts[0].second, central, 2, 1);
      paint_chain(wts[1].second, central, 2, 1);
      paint_chain(wts[2].second, central, 2, 1);
      return true;
    } else if (wts[1].first >= 3) {
      answer[central] = 4;
      answer[wts[0].second] = 2;
      paint_chain(wts[1].second, central, 3, 1);
      paint_chain(wts[2].second, central, 3, 1);
      return true;
    } else if (wts[1].first == 2 && wts[2].first >= 5) {
      answer[central] = 6;
      answer[wts[0].second] = 3;
      paint_chain(wts[1].second, central, 4, 2);
      paint_chain(wts[2].second, central, 5, 1);
      return true;
    }
  }
  return false;
}
void work(void) {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) uf[i] = i;
  for (int i = 1; i <= m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    if (find(u) == find(v)) {
      int ignore1, ignore2;
      for (int j = 1; j <= m - i; j++) {
        scanf("%d%d", &ignore1, &ignore2);
      }
      dfs(u, 0, 0);
      paint_route(u, v, 1);
      answer_yes();
      return;
    }
    un(u, v);
    graph[u].push_back(v);
    graph[v].push_back(u);
    degree[u]++;
    degree[v]++;
  }
  vector<int> roots;
  for (int i = 1; i <= n; i++) {
    roots.push_back(find(i));
  }
  sort(roots.begin(), roots.end());
  for (int i = 0; i < n; i++) {
    if (i == 0 || roots[i] != roots[i - 1]) {
      if (work_component(roots[i])) {
        answer_yes();
        return;
      }
    }
  }
  printf("NO\n");
}
void cleanup(void) {
  for (int i = 1; i <= n; i++) {
    degree[i] = 0;
    answer[i] = 0;
    graph[i].clear();
  }
}
int main() {
  int T;
  scanf("%d", &T);
  for (int i = 1; i <= T; i++) {
    work();
    cleanup();
  }
  return 0;
}