#include <bits/stdc++.h>
using namespace std;
const long long maxn = 5e5 + 7;
const long long mod = 1e9 + 7;
const long long INF = 1e9 + 7;
const long long mlog = 20;
const long long SQ = 400;
long long n, m;
long long root;
long long d[maxn], p[maxn], h[maxn], mark[maxn], good[maxn];
vector<long long> adj[maxn];
queue<long long> q;
bool cmp(long long u, long long v) { return h[u] < h[v]; }
bool pre_dfs(long long v) {
  long long mx = -1;
  mark[v] = true;
  for (long long u : adj[v])
    if (mark[u] && h[u] < h[v] - 1 && (!~mx || h[u] > h[mx])) mx = u;
  if (~mx && h[v] - h[mx] + 1 < n && d[mx] % 3 > 1) {
    for (; v ^ p[mx]; v = p[v]) good[v] = true;
    return true;
  }
  for (long long u : adj[v])
    if (!mark[u]) {
      h[u] = h[v] + 1, p[u] = v;
      if (pre_dfs(u)) return true;
    }
  return false;
}
void pro_dfs(long long v) {
  mark[v] = true;
  for (long long u : adj[v])
    if (!mark[u]) pro_dfs(u);
}
bool has_3k_vert() {
  for (long long i = 0; i < n; i++)
    if (d[i] % 3 < 1 && n > 1) return good[i] = true;
  return false;
}
bool has_121_path() {
  p[root] = -1, mark[root] = true;
  q.push(root);
  while (!q.empty()) {
    long long v = q.front();
    q.pop();
    if (v ^ root && d[v] % 3 == 1 && h[v] < n - 1) {
      for (; ~v; good[v] = true, v = p[v])
        ;
      for (; !q.empty(); q.pop())
        ;
      return true;
    }
    for (long long u : adj[v])
      if (!mark[u]) q.push(u), mark[u] = true, p[u] = v, h[u] = h[v] + 1;
  }
  return false;
}
bool has_2_cycle() {
  return p[root < n ? root : 0] = -1, fill(mark, mark + n, false),
                             pre_dfs(root < n ? root : 0);
}
bool has_122_comp() {
  bool flag = false;
  fill(mark, mark + n, false), mark[root] = good[root] = true,
                               sort(adj[root].begin(), adj[root].end(), cmp);
  for (long long u : adj[root])
    if (!mark[u] && h[u] > 1) {
      long long v = u;
      for (good[u] = true; p[v] ^ root; good[v = p[v]] = true)
        ;
      if (flag) break;
      pro_dfs(v), flag = true;
    }
  return true;
}
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(), cout.tie();
  ;
  long long T;
  cin >> T;
  while (T--) {
    cin >> n >> m;
    for (long long i = 1; i <= m; i++) {
      long long u, v;
      cin >> u >> v;
      u--, v--;
      adj[u].push_back(v), adj[v].push_back(u);
      d[u]++, d[v]++;
    }
    for (root = 0; root < n && d[root] % 3 ^ 1; root++)
      ;
    if (has_3k_vert() || (root < n && has_121_path()) || has_2_cycle() ||
        (root < n && d[root] > 4 && has_122_comp())) {
      vector<long long> vec;
      for (long long i = 0; i < n; i++)
        if (!good[i]) vec.push_back(i);
      cout << "Yes\n";
      cout << vec.size() << "\n";
      for (long long x : vec) cout << x + 1 << " ";
      cout << "\n";
    } else {
      cout << "No\n";
    }
    for (long long v = 0; v < n; v++)
      d[v] = h[v] = 0, adj[v].clear(), mark[v] = good[v] = false;
  }
  return 0;
}
