#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int maxn = 5e5 + 10;
const long long mod = 1e9 + 7;
long long pw(long long a, long long b, long long md = mod) {
  long long res = 1;
  while (b) {
    if (b & 1) {
      res = (a * res) % md;
    }
    a = (a * a) % md;
    b >>= 1;
  }
  return (res);
}
int q, d[maxn], n, m, srt[maxn];
vector<int> adj[maxn];
int par[maxn], mark[maxn];
int dook[maxn], cnt;
queue<int> qu;
vector<int> ans;
int D[maxn], h[maxn];
void print() {
  cnt++;
  for (auto u : ans) dook[u] = cnt;
  cout << "Yes" << '\n';
  cout << n - int(ans.size()) << '\n';
  assert(int(ans.size()) < n);
  for (int i = 1; i <= n; i++) D[i] = d[i];
  for (int i = 1; i <= n; i++) {
    if (dook[i] ^ cnt) {
      cout << i << ' ';
      for (auto u : adj[i]) d[u] += 2;
    }
  }
  for (int i = 1; i <= n; i++) {
    d[i] %= 3;
    if (dook[i] == cnt) assert(d[i] == D[i]);
  }
  cout << '\n';
}
bool chk0() {
  bool ok = 0;
  for (int i = 1; i <= n; i++)
    if (d[i] == 0) ok = 1;
  if (ok) {
    ans.clear();
    for (int i = 1; i <= n; i++)
      if (d[i] == 0) {
        ans.push_back(i);
        print();
        return 1;
      }
  }
  return 0;
}
bool dfsC(int v) {
  mark[v] = 1;
  int id = 0;
  for (auto u : adj[v])
    if (d[u] == 2 and u ^ par[v] and mark[u] and (!id || h[u] > h[id])) id = u;
  if (id) {
    ans.push_back(id);
    while (v ^ id) ans.push_back(v), v = par[v];
    return 1;
  }
  for (auto u : adj[v])
    if (d[u] == 2 and u ^ par[v] and !mark[u]) {
      par[u] = v;
      h[u] = h[v] + 1;
      if (dfsC(u)) return 1;
    }
  return 0;
}
bool chkC() {
  for (int i = 1; i <= n; i++) par[i] = 0, mark[i] = 0, h[i] = 0;
  cnt++;
  for (int i = 1; i <= n; i++) {
    if (d[srt[i]] ^ 2) return 0;
    ans.clear();
    if (!mark[srt[i]] and dfsC(srt[i])) {
      if (ans.size() == n) {
        if (m == n) return 0;
        pair<int, int> psps = {-1, -1};
        for (int j = 0; j < n; j++)
          if (int(adj[ans[j]].size()) > 2) {
            int x = ans[j];
            for (auto u : adj[x])
              if (u != ans[(j + 1) % n] and u != ans[((j - 1 + n) % n)]) {
                psps = pair<int, int>(j, u);
              }
          }
        if (psps == pair<int, int>(-1, -1)) return 0;
        vector<int> tmp;
        for (int j = psps.first;; j = (j + 1) % n) {
          tmp.push_back(ans[j]);
          if (ans[j] == psps.second) break;
        }
        swap(ans, tmp);
      }
      print();
      return 1;
    }
  }
  return 0;
}
bool chkP() {
  int cnt1 = 0;
  for (int i = 1; i <= n; i++) cnt1 += d[i] == 1;
  if (cnt1 == 2 and m == n - 1) return 0;
  if (cnt1 < 2) return 0;
  cnt++;
  for (int i = 1; i <= n; i++) par[i] = 0, mark[i] = 0;
  while (!qu.empty()) qu.pop();
  ans.clear();
  for (int i = 1; i <= n; i++) {
    if (d[i] == 1) {
      qu.push(i), mark[i] = cnt;
      break;
    }
  }
  while (qu.size()) {
    int v = qu.front();
    qu.pop();
    for (auto u : adj[v])
      if (mark[u] ^ cnt) {
        par[u] = v;
        qu.push(u);
        mark[u] = cnt;
        if (d[u] == 1) {
          while (u) ans.push_back(u), u = par[u];
          while (qu.size()) qu.pop();
          break;
        }
      }
  }
  print();
  return 1;
}
void dfs(int v) {
  mark[v] = 1;
  if (dook[v] == cnt) {
    ans.push_back(v);
    cnt++;
    mark[v] = 2;
  }
  for (auto u : adj[v])
    if (!mark[u]) {
      dfs(u);
      if (mark[u] == 2) mark[v] = 2, ans.push_back(v);
    }
}
bool chkT(int v) {
  for (int i = 1; i <= n; i++) mark[i] = 0, par[i] = 0;
  ans.clear();
  mark[v] = 1;
  cnt++;
  int res = 0;
  for (auto u : adj[v]) dook[u] = cnt;
  for (auto u : adj[v])
    if (!mark[u] and (int) adj[u].size() - 1 == 1 and res ^ 2) {
      res++;
      dook[u] = cnt - 1;
      dfs(u);
      cnt--;
    }
  ans.push_back(v);
  if (ans.size() == n) return 0;
  print();
  return 1;
}
int32_t main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> q;
  for (int Q = 0; Q < q; Q++) {
    cin >> n >> m;
    for (int i = 1; i <= n; i++) d[i] = 0, adj[i].clear(), srt[i] = i;
    ;
    for (int i = 1; i <= m; i++) {
      int u, v;
      cin >> u >> v;
      adj[u].push_back(v), adj[v].push_back(u);
      d[u]++, d[v]++;
    }
    if (n == 1) {
      cout << "No" << '\n';
      continue;
    }
    for (int i = 1; i <= n; i++) d[i] %= 3;
    sort(srt + 1, srt + n + 1, [](int i, int j) { return d[i] > d[j]; });
    if (chk0()) continue;
    if (chkP()) continue;
    int cnt1 = 0;
    for (int i = 1; i <= n; i++)
      if (d[i] == 1) cnt1++;
    if (cnt1 == 2 and m == n - 1) {
      cout << "No" << '\n';
      continue;
    }
    if (chkC()) continue;
    if (cnt1 == 0) {
      cout << "No" << '\n';
      continue;
    }
    int v = 0;
    for (int i = 1; i <= n; i++)
      if (d[i] == 1) v = i;
    if (chkT(v)) continue;
    cout << "No" << '\n';
  }
  return (0);
}
