Students of Winter Informatics School are going to live in a set of houses connected by underground passages. Teachers are also going to live in some of these houses, but they can not be accommodated randomly. For safety reasons, the following must hold:

  * All passages between two houses will be closed, if there are no teachers in both of them. All other passages will stay open. 
  * It should be possible to travel between any two houses using the underground passages that are open. 
  * Teachers should not live in houses, directly connected by a passage. 



Please help the organizers to choose the houses where teachers will live to satisfy the safety requirements or determine that it is impossible.

Input

The first input line contains a single integer t — the number of test cases (1 ≤ t ≤ 10^5). 

Each test case starts with two integers n and m (2 ≤ n ≤ 3 ⋅ 10^5, 0 ≤ m ≤ 3 ⋅ 10^5) — the number of houses and the number of passages.

Then m lines follow, each of them contains two integers u and v (1 ≤ u, v ≤ n, u ≠ v), describing a passage between the houses u and v. It is guaranteed that there are no two passages connecting the same pair of houses.

The sum of values n over all test cases does not exceed 3 ⋅ 10^5, and the sum of values m over all test cases does not exceed 3 ⋅ 10^5.

Output

For each test case, if there is no way to choose the desired set of houses, output "NO". Otherwise, output "YES", then the total number of houses chosen, and then the indices of the chosen houses in arbitrary order.

Examples

Input


2
3 2
3 2
2 1
4 2
1 4
2 3


Output


YES
2
1 3 
NO


Input


1
17 27
1 8
2 9
3 10
4 11
5 12
6 13
7 14
8 9
8 14
8 15
9 10
9 15
10 11
10 15
10 17
11 12
11 17
12 13
12 16
12 17
13 14
13 16
14 16
14 15
15 16
15 17
16 17


Output


YES
8
1 3 4 5 6 9 14 17 

Note

The picture below shows the second example test. 

<image>

Source: codeforces | Difficulty: HARD
Tags: Graph algorithms

Graph traversal

Constructive algorithms

Greedy algorithms

Flows and cuts


Solutions:
import io
import os
from collections import deque

def solve(N, M, edges):
	graph = [[] for i in range(N)]
	for (u, v) in edges:
		graph[u].append(v)
		graph[v].append(u)
	source = 0
	q = deque([source])
	isTeacher = {}
	while q:
		node = q.popleft()
		if node in isTeacher:
			continue
		for nbr in graph[node]:
			if nbr in isTeacher and isTeacher[nbr] == 1:
				isTeacher[node] = 0
				break
		else:
			isTeacher[node] = 1
		for nbr in graph[node]:
			if nbr not in isTeacher:
				q.append(nbr)
	if len(isTeacher) != N:
		return 'NO'
	ans = [str(k + 1) for (k, v) in isTeacher.items() if v]
	return 'YES\n' + str(len(ans)) + '\n' + ' '.join(ans)
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
TC = int(input())
for tc in range(1, TC + 1):
	(N, M) = [int(x) for x in input().split()]
	edges = [[int(x) - 1 for x in input().split()] for i in range(M)]
	ans = solve(N, M, edges)
	print(ans)


from sys import stdin, stdout

def strange_housing(n, m, uv_d):
	c_a = [-1] * (n + 1)
	st = [1]
	while len(st) > 0:
		c = st.pop()
		if c_a[c] != -1:
			continue
		c_a[c] = 1
		s = set()
		if c in uv_d:
			for nc in uv_d[c]:
				if c_a[nc] == -1:
					c_a[nc] = 0
					s.add(nc)
		for nc in s:
			if nc in uv_d:
				for nnc in uv_d[nc]:
					if c_a[nnc] == -1:
						st.append(nnc)
	r = []
	for i in range(1, n + 1):
		if c_a[i] == -1:
			return ['NO']
		elif c_a[i] == 1:
			r.append(i)
	return ['YES', len(r), r]
t = int(stdin.readline())
for _ in range(t):
	(n, m) = map(int, stdin.readline().split())
	uv_d = {}
	for _ in range(m):
		(u, v) = map(int, stdin.readline().split())
		if u not in uv_d:
			uv_d[u] = []
		if v not in uv_d:
			uv_d[v] = []
		uv_d[u].append(v)
		uv_d[v].append(u)
	r = strange_housing(n, m, uv_d)
	stdout.write(r[0] + '\n')
	if len(r) > 1:
		stdout.write(str(r[1]) + '\n')
		stdout.write(' '.join(map(str, r[2])) + '\n')


import os
import sys
from io import BytesIO, IOBase
import heapq as h
from bisect import bisect_left, bisect_right
import time
from types import GeneratorType
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		import os
		self.os = os
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			self.os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from collections import defaultdict as dd, deque as dq, Counter as dc
import math, string
start_time = time.time()

def getInts():
	return [int(s) for s in input().split()]

def getInt():
	return int(input())

def getStrs():
	return [s for s in input().split()]

def getStr():
	return input()

def listStr():
	return list(input())

def getMat(n):
	return [getInts() for _ in range(n)]

def isInt(s):
	return '0' <= s[0] <= '9'
MOD = 10 ** 9 + 7

def solve():
	(N, M) = getInts()
	graph = dd(set)
	for m in range(M):
		(u, v) = getInts()
		u -= 1
		v -= 1
		graph[u].add(v)
		graph[v].add(u)
	levels = [-1] * N
	levels[0] = 1
	queue = []
	for neigh in graph[0]:
		queue.append(neigh)
		levels[neigh] = 0
	i = 0
	while i < len(queue):
		for neigh in graph[queue[i]]:
			if levels[neigh] == -1:
				levels[neigh] = 1
				for neigh2 in graph[neigh]:
					if levels[neigh2] == -1:
						levels[neigh2] = 0
						queue.append(neigh2)
		i += 1
	ans = []
	for (i, l) in enumerate(levels):
		if l == -1:
			print('NO')
			return
		if l == 1:
			ans.append(i + 1)
	print('YES')
	print(len(ans))
	print(*ans)
	return
for _ in range(getInt()):
	solve()


import sys
input = sys.stdin.buffer.readline
from collections import deque
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	edge = [[] for i in range(n)]
	for i in range(m):
		(u, v) = map(int, input().split())
		edge[u - 1].append(v - 1)
		edge[v - 1].append(u - 1)
	color = [-1 for i in range(n)]
	used = [False] * n
	color[0] = 0
	used[0] = True
	stack = [0]
	for nv in edge[0]:
		color[nv] = 1
	while stack:
		v = stack[-1]
		if edge[v]:
			nv = edge[v].pop()
			if color[v] == 0:
				if not used[nv]:
					used[nv] = True
					stack.append(nv)
			elif not used[nv] and color[nv] == -1:
				used[nv] = True
				color[nv] = 0
				for nnv in edge[nv]:
					color[nnv] = 1
				stack.append(nv)
		else:
			stack.pop()
	if not all((color[v] != -1 for v in range(n))):
		print('NO')
	else:
		print('YES')
		ans = []
		for i in range(n):
			if color[i] == 0:
				ans.append(i + 1)
		print(len(ans))
		print(*ans)


from collections import deque
import os
import io
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
cases = int(input())
for _ in range(cases):
	(n, m) = map(int, input().split())
	adj = [set() for i in range(n + 1)]
	visited = [False] * (n + 1)
	for i in range(m):
		(start, end) = map(int, input().split())
		adj[start].add(end)
		adj[end].add(start)
	queue = deque()
	uncolored = deque()
	uncolored.append(1)
	solution = []
	allE = 0
	while uncolored:
		index = uncolored.popleft()
		if visited[index]:
			continue
		visited[index] = True
		allE += 1
		solution.append(str(index))
		for i in adj[index]:
			if not visited[i]:
				queue.append(i)
		while queue:
			indexQ = queue.popleft()
			if visited[indexQ]:
				continue
			visited[indexQ] = True
			allE += 1
			for i in adj[indexQ]:
				if not visited[i]:
					uncolored.append(i)
	if allE == n:
		print('YES')
		print(len(solution))
		print(' '.join(solution))
	else:
		print('NO')


import io, os
readline = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
T = int(readline())
Ans = []
for qu in range(T):
	(N, M) = map(int, readline().split())
	Edge = [[] for _ in range(N)]
	for _ in range(M):
		(u, v) = map(int, readline().split())
		u -= 1
		v -= 1
		Edge[u].append(v)
		Edge[v].append(u)
	col = [-1] * N
	col[0] = 0
	stack = [0]
	while stack:
		vn = stack.pop()
		if col[vn] == 2:
			col[vn] = 0
		if col[vn] == 0:
			for vf in Edge[vn]:
				if col[vf] == -1:
					col[vf] = 1
					stack.append(vf)
				else:
					col[vf] = 1
		else:
			for vf in Edge[vn]:
				if col[vf] == -1:
					col[vf] = 2
					stack.append(vf)
	if -1 in col:
		Ans.append('NO')
	else:
		Ans.append('YES')
		Ans.append(str(col.count(0)))
		L = [l + 1 for l in range(N) if col[l] == 0]
		Ans.append(' '.join(map(str, L)))
print('\n'.join(Ans))


import sys
import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

def ngsearch(x):
	for to in E[x]:
		if NG[to] == 0:
			NG[to] = 1
			Q.append(to)
t = int(input())
for tests in range(t):
	(n, m) = map(int, input().split())
	E = [[] for i in range(n + 1)]
	for i in range(m):
		(x, y) = map(int, input().split())
		E[x].append(y)
		E[y].append(x)
	OK = [0] * (n + 1)
	NG = [0] * (n + 1)
	Q = []
	ngsearch(1)
	while Q:
		x = Q.pop()
		for to in E[x]:
			if NG[to] == 0:
				OK[to] = 1
				ngsearch(to)
	count = 0
	ANS = []
	for i in range(1, n + 1):
		if OK[i] == 1 or NG[i] == 1:
			count += 1
		if OK[i] == 1:
			ANS.append(i)
	if count == n:
		print('YES')
		print(len(ANS))
		print(*ANS)
	else:
		print('NO')


import sys, os, io
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
from collections import deque

class Graph:

	def __init__(self, N, M=-1):
		self.V = N
		if M >= 0:
			self.E = M
		self.edge = [[] for _ in range(self.V)]
		self.color = [-1] * self.V

	def add_edges(self, ind=1, bi=True):
		for i in range(self.E):
			(a, b) = map(int, input().split())
			a -= ind
			b -= ind
			self.edge[a].append(b)
			if bi:
				self.edge[b].append(a)

	def bfs(self, start):
		d = deque([start])
		self.color[start] = 1
		while len(d) > 0:
			v = d.popleft()
			for w in self.edge[v]:
				if self.color[w] == -1:
					self.color[w] = self.color[v] ^ 1
					d.append(w)
				elif self.color[w] == self.color[v] == 1:
					self.color[w] = 0
					d.append(w)
T = int(input())
for t in range(T):
	(N, M) = map(int, input().split())
	G = Graph(N, M)
	G.add_edges(ind=1, bi=True)
	G.bfs(0)
	if min(G.color) == -1:
		print('NO')
		continue
	print('YES')
	ans = []
	for i in range(N):
		if G.color[i] == 1:
			ans.append(i + 1)
	print(len(ans))
	print(*ans)


import sys, io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
out = []
t = int(input())
for _ in range(t):
	(n, m) = map(int, input().split())
	adj = [[] for _ in range(n)]
	color = [-1] * n
	color[0] = 0
	for _ in range(m):
		(u, v) = map(int, input().split())
		adj[u - 1].append(v - 1)
		adj[v - 1].append(u - 1)
	stack = [0]
	while stack:
		nex = stack.pop()
		for v in adj[nex]:
			if color[nex] == 1:
				if color[v] == -1:
					stack.append(v)
				color[v] = 0
			elif color[v] == -1:
				color[v] = 1 - color[nex]
				stack.append(v)
	for v in color:
		if v == -1:
			out.append('NO')
			break
	else:
		out.append('YES')
		final = [i + 1 for i in range(n) if color[i]]
		out.append(str(len(final)))
		out.append(' '.join(map(str, final)))
print('\n'.join(out))


import os
import sys
from io import BytesIO, IOBase

def main():
	for _ in range(int(input())):
		(n, m) = map(int, input().split())
		adjacencyList = []
		for _ in range(n):
			adjacencyList.append([])
		for _ in range(m):
			(x, y) = map(int, input().split())
			adjacencyList[x - 1].append(y - 1)
			adjacencyList[y - 1].append(x - 1)
		isCovered = [False] * n
		neighborList = [0]
		ans = []
		while neighborList:
			cur = neighborList.pop()
			if isCovered[cur]:
				continue
			ans.append(cur + 1)
			isCovered[cur] = True
			for elem in adjacencyList[cur]:
				if not isCovered[elem]:
					isCovered[elem] = True
					for elem2 in adjacencyList[elem]:
						neighborList.append(elem2)
		if sum(isCovered) == n:
			print('YES')
			print(len(ans))
			print(' '.join(map(str, ans)))
		else:
			print('NO')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):

	def __init__(self, file):
		self.newlines = 0
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline()

def RL():
	return map(int, sys.stdin.readline().split())

def RLL():
	return list(map(int, sys.stdin.readline().split()))

def N():
	return int(input())

def S():
	return input().strip()

def print_list(l):
	print(' '.join(map(str, l)))
for _ in range(N()):
	(n, m) = RL()
	(see, f) = ([0] * (n + 1), [0] * (n + 1))
	dic = [[] for _ in range(n + 1)]
	for _ in range(m):
		(u, v) = RL()
		dic[u].append(v)
		dic[v].append(u)
	now = [1]
	see[0] = see[1] = 1
	teacher = []
	while now:
		node = now.pop()
		live = 0
		if f[node] == 0:
			teacher.append(node)
			f[node] = 1
			live = 1
		for child in dic[node]:
			f[child] |= live
			if not see[child]:
				see[child] = 1
				now.append(child)
	if 0 in see:
		print('NO')
	else:
		print('YES')
		print(len(teacher))
		print_list(teacher)