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;
using int64 = long long int;
namespace io {
template <typename T>
T Read() {
  T result;
  cin >> result;
  return result;
}
string ReadWord() { return Read<string>(); }
template <typename T>
vector<T> ReadVector(const int n) {
  vector<T> result(n);
  for (int i = 0; i < n; ++i) {
    result[i] = Read<T>();
  }
  return result;
}
}  // namespace io
class Graph {
 public:
  explicit Graph(const int n) : edges_(n) {}
  void AddEdge(const int from, const int to) {
    edges_[from].push_back(to);
    edges_[to].push_back(from);
  }
  void Process() {
    const int n = edges_.size();
    mark_.assign(n, 0);
    values_.assign(n, 0);
    int color = 0;
    for (int i = 0; i < n; ++i) {
      if (mark_[i]) {
        continue;
      }
      ++color;
      if (ProcessComponent(i, color)) {
        PrintAnswer(true);
        return;
      }
    }
    PrintAnswer(false);
  }

 private:
  bool ProcessComponent(const int u, const int color) {
    num_nodes_ = num_edges_ = 0;
    high_degree_nodes_.clear();
    Dfs(u, color);
    num_edges_ /= 2;
    if (num_edges_ >= num_nodes_) {
      const int n = edges_.size();
      for (int i = 0; i < n; ++i) {
        values_[i] = (mark_[i] == color ? 1 : 0);
      }
      return true;
    }
    if (high_degree_nodes_.empty()) {
      return false;
    }
    const int root = high_degree_nodes_[0];
    if (edges_[root].size() >= 4) {
      values_[root] = 2;
      for (const int v : edges_[root]) {
        values_[v] = 1;
      }
      return true;
    }
    if (high_degree_nodes_.size() >= 2) {
      const int child = high_degree_nodes_[1];
      for (const int v : edges_[root]) {
        values_[v] = 1;
      }
      for (const int v : edges_[child]) {
        values_[v] = 1;
      }
      SetValuesForPath(root, -1, child);
      return true;
    }
    const vector<int>& c = edges_[root];
    for (int i = 0; i < 3; ++i) {
      if (edges_[c[i]].size() == 1) {
        return ProcessRootWithLeaf(root, c[i], c[(i + 1) % 3], c[(i + 2) % 3]);
      }
    }
    for (int i = 0; i < 3; ++i) {
      for (const int v : edges_[c[i]]) {
        values_[v] = 1;
      }
      values_[c[i]] = 2;
    }
    values_[root] = 3;
    return true;
  }
  bool ProcessRootWithLeaf(const int root, const int leaf, const int c1,
                           const int c2) {
    if (edges_[c1].size() == 1 || edges_[c2].size() == 1) {
      return false;
    }
    vector<int> p1 = BuildPath(root, c1);
    vector<int> p2 = BuildPath(root, c2);
    if (p1.size() < p2.size()) {
      swap(p1, p2);
    }
    if (p1.size() >= 3 && p2.size() >= 3) {
      values_[root] = 4;
      values_[p1[0]] = values_[p2[0]] = 3;
      values_[p1[1]] = values_[p2[1]] = 2;
      values_[p1[2]] = values_[p2[2]] = 1;
      values_[leaf] = 2;
      return true;
    }
    if (p1.size() >= 5 && p2.size() >= 2) {
      values_[root] = 6;
      for (int i = 0; i < 5; ++i) {
        values_[p1[i]] = 5 - i;
      }
      values_[p2[0]] = 4;
      values_[p2[1]] = 2;
      values_[leaf] = 3;
      return true;
    }
    return false;
  }
  vector<int> BuildPath(int parent, int cur) {
    vector<int> path;
    while (true) {
      path.push_back(cur);
      if (edges_[cur].size() == 1) {
        return path;
      }
      if (edges_[cur][0] != parent) {
        parent = cur;
        cur = edges_[cur][0];
      } else {
        parent = cur;
        cur = edges_[cur][1];
      }
    }
  }
  bool SetValuesForPath(const int cur, const int parent, const int target) {
    if (cur == target) {
      values_[cur] = 2;
      return true;
    }
    for (const int v : edges_[cur]) {
      if (v != parent && SetValuesForPath(v, cur, target)) {
        values_[cur] = 2;
        return true;
      }
    }
    return false;
  }
  void PrintAnswer(const bool found) {
    if (found) {
      cout << "YES\n";
      const int n = edges_.size();
      for (int i = 0; i < n; ++i) {
        cout << values_[i] << " ";
      }
      cout << "\n";
    } else {
      cout << "NO\n";
    }
  }
  void Dfs(const int u, const int color) {
    mark_[u] = color;
    ++num_nodes_;
    if (edges_[u].size() >= 3) {
      high_degree_nodes_.push_back(u);
    }
    for (const int v : edges_[u]) {
      ++num_edges_;
      if (!mark_[v]) {
        Dfs(v, color);
      }
    }
  }
  vector<vector<int>> edges_;
  vector<int> mark_;
  vector<int> values_;
  int num_nodes_;
  int num_edges_;
  vector<int> high_degree_nodes_;
};
void SolveSingleTest() {
  const int n = io::Read<int>();
  const int m = io::Read<int>();
  Graph g(n);
  for (int i = 0; i < m; ++i) {
    const int u = io::Read<int>() - 1;
    const int v = io::Read<int>() - 1;
    g.AddEdge(u, v);
  }
  g.Process();
}
int main() {
  const int n = io::Read<int>();
  for (int i = 0; i < n; ++i) {
    SolveSingleTest();
  }
  return 0;
}