#include <bits/stdc++.h>
const int max_N = 1000005;
const int INF = 2e9;
int t, n, m, deg[max_N], Deg[max_N], fa[max_N], dist[max_N], dep[max_N], XX, YY;
std::vector<int> Edge[max_N], vec;
bool vis[max_N], flag;
int read() {
  char c = getchar();
  int ans = 0;
  while (c < '0' || c > '9') c = getchar();
  while (c >= '0' && c <= '9') ans = ans * 10 + c - '0', c = getchar();
  return ans;
}
void Write(int x) {
  if (x < 10)
    putchar(x + '0');
  else
    Write(x / 10), putchar(x % 10 + '0');
}
void putout() {
  for (int i = 1; i <= n; i++) vis[i] = false;
  for (auto i : vec) vis[i] = true;
  vec.clear();
  for (int i = 1; i <= n; i++)
    if (!vis[i]) vec.push_back(i);
  Write(vec.size()), putchar('\n');
  for (auto i : vec) Write(i), putchar(' ');
  putchar('\n');
  for (int i = 1; i <= n; i++) Deg[i] = 0;
  for (int i = 1; i <= n; i++)
    for (auto j : Edge[i])
      if (i < j && vis[i] && vis[j]) Deg[i]++, Deg[j]++;
  for (int i = 1; i <= n; i++)
    if (vis[i]) assert(deg[i] % 3 == Deg[i] % 3);
}
void get_dist(int x) {
  for (int i = 1; i <= n; i++) dist[i] = INF;
  std::queue<int> Q;
  Q.push(x);
  dist[x] = 0;
  while (!Q.empty()) {
    int now = Q.front();
    Q.pop();
    for (auto i : Edge[now])
      if (dist[i] == INF) dist[i] = dist[now] + 1, Q.push(i);
  }
}
void dfs1(int x) {
  vis[x] = true;
  for (auto i : Edge[x])
    if (deg[i] % 3 == 2) {
      if (fa[x] == i) continue;
      if (vis[i] && dep[i] < dep[x]) {
        if (XX == -1 || dep[XX] > dep[x] ||
            dep[XX] == dep[x] && dep[YY] < dep[i])
          XX = x, YY = i, flag = true;
      } else if (!vis[i])
        fa[i] = x, dep[i] = dep[x] + 1, dfs1(i);
    }
}
void dfs2(int x, int fa, int p) {
  vec.push_back(x);
  for (auto i : Edge[x]) {
    if (i == fa || i == p || flag || dist[i] != dist[x] + 1) continue;
    if (deg[i] % 3 == 1) {
      vec.push_back(i);
      flag = true;
      if (vec.size() == n)
        puts("NO");
      else
        puts("YES"), putout();
    } else
      dfs2(i, x, p);
  }
  vec.pop_back();
}
void dfs3(int x, int fa) {
  vec.push_back(x);
  for (auto i : Edge[x])
    if (i != fa && !flag && deg[i] % 3 == 1) flag = true;
  for (auto i : Edge[x])
    if (i != fa && !flag) dfs3(i, x);
  if (!flag) vec.pop_back();
}
void dfs4(int x) {
  vis[x] = true;
  for (auto i : Edge[x])
    if (deg[i] % 3 == 2 && !vis[i]) dfs4(i);
}
void check() {
  n = read(), m = read();
  for (int i = 1, u, v; i <= m; i++)
    u = read(), v = read(), Edge[u].push_back(v), Edge[v].push_back(u),
    ++deg[u], ++deg[v];
  if (n == 1) return puts("NO"), void();
  for (int i = 1; i <= n && !flag; i++)
    if (deg[i] % 3 == 0)
      flag = true, vec = std::vector<int>{i}, puts("YES"), putout();
  for (int i = 1; i <= n && !flag; i++)
    if (deg[i] % 3 == 2 && !vis[i]) {
      XX = YY = -1, dep[i] = 0, dfs1(i);
      if (flag) {
        assert(XX != -1), vec.push_back(YY);
        while (XX != YY) vec.push_back(XX), XX = fa[XX];
        if (vec.size() == n)
          puts("NO");
        else
          puts("YES"), putout();
      }
    }
  int cnt1 = 0, e = 0;
  for (int i = 1; i <= n && !flag; i++)
    if (deg[i] % 3 == 1) cnt1++, e = i;
  if (cnt1 > 1 && !flag) {
    for (int i = 1; i <= n && !flag; i++)
      if (deg[i] % 3 == 1) get_dist(i), dfs2(i, 0, i);
  }
  if (cnt1 == 1 && !flag) {
    for (int i = 1; i <= n; i++) vis[i] = false;
    for (auto i : Edge[e]) {
      if (flag || vis[i]) continue;
      if (vec.empty())
        dfs4(i), dfs3(i, e), assert(flag), flag = false;
      else
        dfs4(i), dfs3(i, e);
    }
    vec.push_back(e);
    if (vec.size() == n)
      puts("NO");
    else
      puts("YES"), putout();
  }
  assert(flag);
  flag = false, vec.clear();
  for (int i = 1; i <= n; i++)
    Edge[i].clear(), deg[i] = 0, vis[i] = false, fa[i] = 0;
}
int main() {
  t = read();
  while (t--) check();
  return 0;
}
