
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Server {

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		int var = scanner.nextInt();
		scanner.nextLine();

		Node[] vars = new Node[var];

		for (int i = 0; i < var; i++) {
			vars[i] = analyze(scanner);
			scanner.nextLine();
		}
		scanner.close();
		
		for (int i = 0; i < vars.length; i++) {

			int[] vert = canSteal(vars[i]);
			if (vert == null) {
				System.out.println("No");

			} else {

				System.out.println("Yes");
				System.out.println("3");
				System.out.println(vert[0] + " " + vert[1] + " " + vert[2]);
			}

		}
	}

	static int[] canSteal(Node node) {

		if (node.visited) {
			return null;
		}

		node.visited = true;

		if (node.nodes.size() >= 3) {

			List<Node> common = new ArrayList<>();
			for (int i = 0; i < node.nodes.size(); i++) {
				if(node.nodes.get(i).nodes.size()==1)
				{
					common.add(node.nodes.get(i));
				}

				if (common.size() >= 3) {
					int[] num = new int[common.size()];
					for (int u = 0; u < num.length; u++) {
						num[u] = common.get(u).num;
					}
					return num;
				}
				
			}

			for (int i = 0; i < node.nodes.size(); i++) {
				Node ch1 = node.nodes.get(i);
				for (int x = 0; x < ch1.nodes.size(); x++) {
					Node ch = ch1.nodes.get(x);
					if (ch == node) {
						continue;
					}
					 common = new ArrayList<>();

					for (int y = 0; y < ch.nodes.size(); y++) {
						if (node.nodes.contains(ch.nodes.get(y)) && ch.nodes.get(y).nodes.size() == 2) {
							common.add(ch.nodes.get(y));
						}
					}

					if (common.size() >= 3) {
						int[] num = new int[common.size()];
						for (int u = 0; u < num.length; u++) {
							num[u] = common.get(u).num;
						}
						return num;
					}
				}
			}

		}

		for (int i = 0; i < node.nodes.size(); i++) {
			int[] can = canSteal(node.nodes.get(i));
			if (can != null) {
				return can;
			}
		}
		return null;
	}

	static class Node {
		List<Node> nodes = new ArrayList<Node>();
		int num;
		boolean visited = false;

		public Node(int x) {
			num = x;
		}

		@Override
		public int hashCode() {
			return num;
		}

		@Override
		public String toString() {
			return num + " ";
		}
	}

	public static Node analyze(Scanner scanner) {

		

		int n = scanner.nextInt();
		int m = scanner.nextInt();
		Node[] nodes = new Node[n];

		for (int i = 0; i < n; i++) {

			nodes[i] = new Node(i + 1);
		}

		for (int i = 0; i < m; i++) {
			scanner.nextLine();

			int v0 = scanner.nextInt();
			int v1 = scanner.nextInt();

			nodes[v0 - 1].nodes.add(nodes[v1 - 1]);
			nodes[v1 - 1].nodes.add(nodes[v0 - 1]);
		}

		return nodes[0];
	}

}
