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

Solution:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Arrays;
import java.util.Collection;
import java.io.IOException;
import java.util.Deque;
import java.util.ArrayList;
import java.io.UncheckedIOException;
import java.util.List;
import java.io.Closeable;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.ArrayDeque;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) throws Exception {
        Thread thread = new Thread(null, new TaskAdapter(), "", 1 << 27);
        thread.start();
        thread.join();
    }

    static class TaskAdapter implements Runnable {
        @Override
        public void run() {
            InputStream inputStream = System.in;
            OutputStream outputStream = System.out;
            FastInput in = new FastInput(inputStream);
            FastOutput out = new FastOutput(outputStream);
            EPerpetualMotionMachine solver = new EPerpetualMotionMachine();
            int testCount = Integer.parseInt(in.next());
            for (int i = 1; i <= testCount; i++)
                solver.solve(i, in, out);
            out.close();
        }
    }

    static class EPerpetualMotionMachine {
        int limit = (int) 1e5;
        List<Node> path = new ArrayList<>(limit);
        List<Node>[] traces = new List[]{new ArrayList(limit), new ArrayList(limit), new ArrayList(limit)};
        Deque<Node> circle = new ArrayDeque<>(limit);

        public void solve(int testNumber, FastInput in, FastOutput out) {
            int n = in.readInt();
            int m = in.readInt();
            Node[] nodes = new Node[n];
            for (int i = 0; i < n; i++) {
                nodes[i] = new Node();
                nodes[i].id = i;
            }

            for (int i = 0; i < m; i++) {
                Node a = nodes[in.readInt() - 1];
                Node b = nodes[in.readInt() - 1];
                a.adj.add(b);
                b.adj.add(a);
            }

            int[] ans = new int[n];
            for (Node node : nodes) {
                circle.clear();
                if (!dfs(node, null)) {
                    continue;
                }
                for (Node x : circle) {
                    ans[x.id] = 1;
                }
                outputAnswer(out, ans);
                return;
            }

            for (Node node : nodes) {
                if (node.adj.size() < 4) {
                    continue;
                }
                for (int i = 0; i < 4; i++) {
                    ans[node.adj.get(i).id] = 1;
                }
                ans[node.id] = 2;
                outputAnswer(out, ans);
                return;
            }

            for (Node node : nodes) {
                if (node.adj.size() < 3) {
                    continue;
                }
                path.clear();
                if (!findPath(node, null, node)) {
                    continue;
                }
                Node head = path.get(0);
                Node tail = path.get(path.size() - 1);
                head.adj.remove(path.get(1));
                tail.adj.remove(path.get(path.size() - 2));

                for (Node nearby : head.adj) {
                    ans[nearby.id] = 1;
                }
                for (Node nearby : tail.adj) {
                    ans[nearby.id] = 1;
                }
                for (Node x : path) {
                    ans[x.id] = 2;
                }
                outputAnswer(out, ans);
                return;
            }

            for (Node node : nodes) {
                if (node.adj.size() < 3) {
                    continue;
                }

                dfsForDepth(node, null, 0);
                for (int i = 0; i < 3; i++) {
                    traces[i].clear();
                    dfsForLongestPath(node.adj.get(i), node, traces[i]);
                }

                Arrays.sort(traces, (a, b) -> a.size() - b.size());
                // 3 3 3
                if (traces[0].size() >= 2) {
                    ans[node.id] = 3;
                    for (int i = 0; i < 2; i++) {
                        for (int j = 0; j < 3; j++) {
                            ans[traces[j].get(i).id] = 2 - i;
                        }
                    }
                    outputAnswer(out, ans);
                    return;
                }

                // 2 4 4
                if (traces[0].size() >= 1 && traces[1].size() >= 2 && traces[2].size() >= 5) {
                    ans[node.id] = 6;
                    ans[traces[0].get(0).id] = 3;
                    for (int i = 0; i < 2; i++) {
                        ans[traces[1].get(i).id] = 6 - (i + 1) * 6 / 3;
                    }
                    for (int i = 0; i < 5; i++) {
                        ans[traces[2].get(i).id] = 6 - (i + 1);
                    }
                    outputAnswer(out, ans);
                    return;
                }

                // 2 4 4
                if (traces[0].size() >= 1 && traces[1].size() >= 3 && traces[2].size() >= 3) {
                    ans[node.id] = 4;
                    ans[traces[0].get(0).id] = 2;
                    for (int i = 0; i < 3; i++) {
                        ans[traces[1].get(i).id] = 4 - (i + 1);
                        ans[traces[2].get(i).id] = 4 - (i + 1);
                    }
                    outputAnswer(out, ans);
                    return;
                }
            }

            out.println("NO");
        }

        public void dfsForDepth(Node root, Node p, int depth) {
            root.farthest = root.depth = depth;
            for (Node node : root.adj) {
                if (node == p) {
                    continue;
                }
                dfsForDepth(node, root, depth + 1);
                root.farthest = Math.max(root.farthest, node.farthest);
            }
        }

        public void dfsForLongestPath(Node root, Node p, List<Node> trace) {
            trace.add(root);
            for (Node node : root.adj) {
                if (node == p) {
                    continue;
                }
                if (root.farthest != node.farthest) {
                    continue;
                }
                dfsForLongestPath(node, root, trace);
                return;
            }
        }

        public boolean findPath(Node root, Node p, Node from) {
            path.add(root);
            if (root != from && root.adj.size() >= 3) {
                return true;
            }

            for (Node node : root.adj) {
                if (node == p) {
                    continue;
                }
                if (findPath(node, root, from)) {
                    return true;
                }
            }

            path.remove(path.size() - 1);
            return false;
        }

        public void outputAnswer(FastOutput out, int[] ans) {
            out.println("YES");
            for (int x : ans) {
                out.append(x).append(' ');
            }
            out.println();
        }

        public boolean dfs(Node root, Node p) {
            if (root.visited) {
                if (root.instk) {
                    while (circle.peekFirst() != root) {
                        circle.removeFirst();
                    }
                    return true;
                }
                return false;
            }
            root.visited = true;
            root.instk = true;
            circle.addLast(root);

            for (Node node : root.adj) {
                if (node == p) {
                    continue;
                }
                if (dfs(node, root)) {
                    return true;
                }
            }

            root.instk = false;
            return false;
        }

    }

    static class FastOutput implements AutoCloseable, Closeable, Appendable {
        private StringBuilder cache = new StringBuilder(10 << 20);
        private final Writer os;

        public FastOutput append(CharSequence csq) {
            cache.append(csq);
            return this;
        }

        public FastOutput append(CharSequence csq, int start, int end) {
            cache.append(csq, start, end);
            return this;
        }

        public FastOutput(Writer os) {
            this.os = os;
        }

        public FastOutput(OutputStream os) {
            this(new OutputStreamWriter(os));
        }

        public FastOutput append(char c) {
            cache.append(c);
            return this;
        }

        public FastOutput append(int c) {
            cache.append(c);
            return this;
        }

        public FastOutput append(String c) {
            cache.append(c);
            return this;
        }

        public FastOutput println(String c) {
            return append(c).println();
        }

        public FastOutput println() {
            cache.append(System.lineSeparator());
            return this;
        }

        public FastOutput flush() {
            try {
                os.append(cache);
                os.flush();
                cache.setLength(0);
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
            return this;
        }

        public void close() {
            flush();
            try {
                os.close();
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
        }

        public String toString() {
            return cache.toString();
        }

    }

    static class Node {
        List<Node> adj = new ArrayList<>();
        int id;
        boolean visited;
        boolean instk;
        int depth;
        int farthest;

        public String toString() {
            return "" + id;
        }

    }

    static class FastInput {
        private final InputStream is;
        private StringBuilder defaultStringBuf = new StringBuilder(1 << 13);
        private byte[] buf = new byte[1 << 13];
        private int bufLen;
        private int bufOffset;
        private int next;

        public FastInput(InputStream is) {
            this.is = is;
        }

        private int read() {
            while (bufLen == bufOffset) {
                bufOffset = 0;
                try {
                    bufLen = is.read(buf);
                } catch (IOException e) {
                    bufLen = -1;
                }
                if (bufLen == -1) {
                    return -1;
                }
            }
            return buf[bufOffset++];
        }

        public void skipBlank() {
            while (next >= 0 && next <= 32) {
                next = read();
            }
        }

        public String next() {
            return readString();
        }

        public int readInt() {
            int sign = 1;

            skipBlank();
            if (next == '+' || next == '-') {
                sign = next == '+' ? 1 : -1;
                next = read();
            }

            int val = 0;
            if (sign == 1) {
                while (next >= '0' && next <= '9') {
                    val = val * 10 + next - '0';
                    next = read();
                }
            } else {
                while (next >= '0' && next <= '9') {
                    val = val * 10 - next + '0';
                    next = read();
                }
            }

            return val;
        }

        public String readString(StringBuilder builder) {
            skipBlank();

            while (next > 32) {
                builder.append((char) next);
                next = read();
            }

            return builder.toString();
        }

        public String readString() {
            defaultStringBuf.setLength(0);
            return readString(defaultStringBuf);
        }

    }
}