#include <bits/stdc++.h>
using namespace std;
const int N = 5000 * 100 + 5;
int n, m, a, b, c, av, bv, cv, deg[N], t, h[N];
vector<int> adj[N], ans, loop;
bool mark[N], vis[N];
void dfs1(int v, int p = -1) {
  loop.push_back(v), vis[v] = true;
  for (auto u : adj[v]) {
    if (ans.empty() && u != p && !vis[u])
      dfs1(u, v), ((loop.size() > 1 && deg[loop.back()] == 1) ||
                   (loop.size() > 1 && deg[loop.back()] == 1))
                      ? swap(ans, loop)
                      : loop.pop_back();
  }
}
void dfs2(int v, int p = -1) {
  loop.push_back(v);
  vis[v] = true;
  int lh = 0, l;
  bool flag = false;
  for (auto u : adj[v])
    if (h[u] > lh && deg[u] == 2 && u != p) lh = h[u], l = u;
  if (ans.empty() && lh) {
    for (auto i : loop) {
      if (l == i) flag = true;
      if (flag) ans.push_back(i);
    }
  }
  for (auto u : adj[v])
    if (ans.empty() && u != p && !vis[u])
      h[u] = h[v] + 1, dfs2(u, v), loop.pop_back();
}
int main() {
  cin >> t;
  while (t--) {
    cin >> n >> m;
    for (int i = 0, v, u; i < m; i++) {
      cin >> v >> u;
      adj[v].push_back(u);
      adj[u].push_back(v);
    }
    for (int i = 1; i <= n; i++) {
      deg[i] = adj[i].size() % 3;
      if (deg[i] == 0)
        a++, av = i;
      else if (deg[i] == 1)
        b++, bv = i;
      else
        c++, cv = i;
    }
    if (a) {
      if (n == 1)
        cout << "NO\n";
      else {
        cout << "YES\n" << n - 1 << '\n';
        for (int i = 1; i <= n; i++)
          if (i != av) cout << i << ' ';
      }
    } else if (b > 1) {
      ans.clear(), loop.clear(), dfs1(bv);
      if (ans.size() == n)
        cout << "NO\n";
      else {
        cout << "YES\n" << n - ans.size() << '\n';
        for (auto i : ans) mark[i] = true;
        for (int i = 1; i <= n; i++)
          if (!mark[i]) cout << i << ' ';
        cout << '\n';
      }
    } else {
      h[cv] = 1, ans.clear(), loop.clear();
      dfs2(cv);
      if (ans.size() == n)
        cout << "NO\n";
      else {
        cout << "YES\n" << n - ans.size() << '\n';
        for (auto i : ans) mark[i] = true;
        for (int i = 1; i <= n; i++)
          if (!mark[i]) cout << i << ' ';
        cout << '\n';
      }
    }
    for (int i = 0; i <= n; i++)
      adj[i].clear(), deg[i] = h[i] = 0, mark[i] = vis[i] = false;
    a = b = c = av = bv = cv = 0;
  }
}
