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;
template <typename T>
inline bool chkmin(T &a, const T &b) {
  return a > b ? a = b, 1 : 0;
}
template <typename T>
inline bool chkmax(T &a, const T &b) {
  return a < b ? a = b, 1 : 0;
}
const int oo = 0x3f3f3f3f;
const int maxn = 100100;
int n, m;
vector<int> adj[maxn + 5];
bool ok = 0;
int ans[maxn + 5];
bool vis[maxn + 5];
int fa[maxn + 5];
vector<int> seq;
int dep[maxn + 5];
void dfs(int first, int f = -1) {
  if (ok) return;
  seq.push_back(first);
  fa[first] = f;
  vis[first] = 1;
  for (auto second : adj[first])
    if (second != f) {
      if (vis[second]) {
        int u = first;
        while (u != second) {
          ans[u] = 1;
          u = fa[u];
        }
        ans[second] = 1;
        ok = 1;
        return;
      } else
        dep[second] = dep[first] + 1, dfs(second, first);
      if (ok) return;
    }
}
bool in_chain[maxn + 5];
inline void work(int rt) {
  seq.clear();
  dep[rt] = 0;
  dfs(rt);
  if (ok) return;
  int cnt = 0;
  for (auto u : seq)
    if ((int((adj[u]).size())) == 1) ++cnt;
  if (cnt > 3) {
    ok = 1;
    for (auto u : seq)
      if ((int((adj[u]).size())) > 1)
        ans[u] = 2;
      else
        ans[u] = 1;
    return;
  } else if (cnt == 3) {
    sort((seq).begin(), (seq).end(),
         [&](int first, int second) { return dep[first] > dep[second]; });
    vector<vector<int> > chains;
    for (auto u : seq)
      if (!in_chain[u]) {
        vector<int> chain;
        int tmp = u;
        while (~tmp) {
          in_chain[tmp] = 1;
          chain.push_back(tmp);
          tmp = fa[tmp];
        }
        reverse((chain).begin(), (chain).end());
        chains.push_back(chain);
      }
    sort((chains).begin(), (chains).end(),
         [&](const vector<int> &a, const vector<int> &b) {
           return (int((a).size())) < (int((b).size()));
         });
    long long sz0 = (int((chains[0]).size()));
    long long sz1 = (int((chains[1]).size()));
    long long sz2 = (int((chains[2]).size()));
    if ((sz0 * sz1 + sz1 * sz2 + sz0 * sz2) > sz0 * sz1 * sz2) return;
    ok = 1;
    if (sz0 >= 3) {
      chains[0].resize(3);
      chains[1].resize(3);
      chains[2].resize(3);
      sz0 = sz1 = sz2 = 3;
    } else if (sz1 >= 4) {
      chains[1].resize(4);
      chains[2].resize(4);
      sz1 = sz2 = 4;
    } else {
      assert(sz2 >= 6);
      chains[2].resize(6);
      sz2 = 4;
    }
    int tmp = sz0 * sz1 * sz2;
    ans[rt] = tmp;
    for (auto u : chains) {
      int first = tmp * ((int((u).size())) - 1) / (int((u).size()));
      for (int i = (0), i_end_ = ((int((u).size()))); i < i_end_; ++i)
        ans[u[i]] = i * first - (i - 1) * tmp;
    }
    return;
  }
}
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    memset(in_chain, 0, sizeof in_chain);
    ok = 0;
    scanf("%d%d", &n, &m);
    for (int i = (0), i_end_ = (n); i < i_end_; ++i) adj[i].clear();
    for (int i = (0), i_end_ = (m); i < i_end_; ++i) {
      int u, v;
      scanf("%d%d", &u, &v), --u, --v;
      adj[u].push_back(v);
      adj[v].push_back(u);
    }
    memset(vis, 0, sizeof(vis[0]) * n);
    memset(ans, 0, sizeof(ans[0]) * n);
    static int pos[maxn + 5];
    for (int i = (0), i_end_ = (n); i < i_end_; ++i) pos[i] = i;
    sort(pos, pos + n, [&](int first, int second) {
      return (int((adj[first]).size())) > (int((adj[second]).size()));
    });
    for (int i = (0), i_end_ = (n); i < i_end_; ++i)
      if (!vis[pos[i]]) {
        work(pos[i]);
        if (ok) break;
      }
    if (ok) {
      puts("YES");
      for (int i = (0), i_end_ = (n); i < i_end_; ++i) printf("%d ", ans[i]);
      printf("\n");
      int sum = 0;
      for (int i = (0), i_end_ = (n); i < i_end_; ++i) {
        for (auto j : adj[i])
          if (j < i) {
            sum += ans[i] * ans[j];
          }
        sum -= ans[i] * ans[i];
      }
    } else
      puts("NO");
  }
  return 0;
}