#include <bits/stdc++.h>
using namespace std;
const long long MXN = 5e5 + 10;
const long long INF = 1e9;
long long n, m, ts;
long long deg[MXN], d3[MXN], dad[MXN], cnt[MXN];
long long dis[MXN], Q[MXN], pr[MXN], comp[MXN];
vector<long long> adj[MXN], G[MXN], vec;
bool mark[MXN], vis[MXN], cyc;
void Brute() {
  for (int mask = 1; mask < (1LL << n) - 1; mask++) {
    bool ok = true;
    long long pc = 0;
    for (int i = 1; i <= n; i++) pc += (mark[i] = ((mask >> (i - 1)) & 1LL));
    for (int u = 1; u <= n; u++) {
      if (!mark[u]) continue;
      long long nd = 0;
      for (auto v : adj[u]) nd += mark[v];
      if (nd % 3 != d3[u]) {
        ok = false;
        break;
      }
    }
    if (ok) {
      cout << "Yes\n" << n - pc << '\n';
      for (int i = 1; i <= n; i++)
        if (!mark[i]) cout << i << ' ';
      cout << '\n';
      return;
    }
  }
  cout << "No\n";
}
bool Pk() {
  long long d1 = 0;
  for (int i = 1; i <= n; i++) {
    if (deg[i] > 2) return 0;
    if (deg[i] == 2) continue;
    d1++;
    if (d1 > 2) return 0;
  }
  return 1;
}
bool Ck() {
  for (int i = 1; i <= n; i++) {
    if (deg[i] != 2) return 0;
  }
  return 1;
}
void BFS2(long long src) {
  for (int i = 0; i <= n; i++) mark[i] = 0, dis[i] = INF;
  long long L = 0, R = 0;
  Q[R++] = src;
  dis[src] = 0, mark[src] = 1, pr[src] = -1;
  while (L < R) {
    long long u = Q[L++];
    for (auto v : G[u]) {
      if (!mark[v]) {
        mark[v] = 1, dis[v] = dis[u] + 1;
        Q[R++] = v, pr[v] = u;
      }
    }
  }
}
void BFS(long long src) {
  for (int i = 0; i <= n; i++) mark[i] = 0, dis[i] = INF;
  long long L = 0, R = 0;
  Q[R++] = src;
  dis[src] = 0, mark[src] = 1, pr[src] = -1;
  while (L < R) {
    long long u = Q[L++];
    for (auto v : adj[u]) {
      if (!mark[v]) {
        mark[v] = 1, dis[v] = dis[u] + 1;
        Q[R++] = v, pr[v] = u;
      }
    }
  }
}
void DFS(long long u, long long c) {
  mark[u] = 1, comp[u] = c;
  for (auto v : G[u]) {
    if (v == dad[u]) continue;
    if (mark[v]) {
      if (!cyc && dis[v] < dis[u]) {
        long long rv = v;
        for (auto adj0 : G[u]) {
          if (adj0 == dad[u]) continue;
          if (mark[adj0]) {
            if (dis[adj0] < dis[u]) {
              rv = (dis[rv] < dis[adj0] ? adj0 : rv);
            }
          }
        }
        cyc = 1;
        long long v1 = u;
        while (v1 != rv) vec.push_back(v1), v1 = dad[v1];
        vec.push_back(rv);
      }
    }
  }
  for (auto v : G[u]) {
    if (v == dad[u]) continue;
    if (!mark[v]) {
      dad[v] = u, dis[v] = dis[u] + 1;
      DFS(v, c);
    }
  }
}
inline void Print(vector<long long> vc, bool nt = 0) {
  if (!nt) {
    cout << "Yes\n" << vc.size() << '\n';
    for (auto x : vc) cout << x << ' ';
    cout << '\n';
    return;
  }
  cout << "Yes\n" << n - vc.size() << '\n';
  for (int i = 1; i <= n; i++) vis[i] = 1;
  for (auto x : vc) vis[x] = 0;
  for (int i = 1; i <= n; i++) {
    if (vis[i]) cout << i << ' ';
  }
  cout << '\n';
}
long long tq = 0, mq;
void solve() {
  tq++;
  cin >> n >> m, ts = 0;
  for (int i = 1; i <= n; i++) G[i].clear(), adj[i].clear(), deg[i] = 0;
  for (int i = 1; i <= m; i++) {
    long long u, v;
    cin >> u >> v;
    adj[u].push_back(v), adj[v].push_back(u);
    deg[u]++, deg[v]++;
  }
  for (int i = 1; i <= n; i++) d3[i] = deg[i] % 3;
  if (n <= 5) {
    Brute();
    return;
  }
  long long v1 = 0, td1 = 0;
  for (int i = 1; i <= n; i++) v1 = (d3[i] == 0 ? i : v1), td1 += (d3[i] == 1);
  if (v1) return Print({v1}, 1);
  for (int i = 1; i <= n; i++)
    if (d3[i] == 1) v1 = i;
  if (td1 >= 2) {
    if (Pk()) {
      cout << "No\n";
      return;
    }
    BFS(v1);
    long long v2 = 0;
    for (int i = 1; i <= n; i++)
      if (d3[i] == 1 && i != v1) v2 = (dis[v2] > dis[i] ? i : v2);
    vec.clear();
    while (v2 != -1) vec.push_back(v2), v2 = pr[v2];
    return Print(vec, 1);
  }
  if (Ck()) {
    cout << "No\n";
    return;
  }
  for (int u = 1; u <= n; u++) {
    mark[u] = 1, comp[u] = 0;
    if (d3[u] != 2) continue;
    for (auto v : adj[u]) {
      if (d3[v] == 2) G[u].push_back(v);
    }
    mark[u] = 0;
  }
  for (int i = 1; i <= n; i++) {
    if (!mark[i]) {
      vec.clear(), cyc = 0;
      dis[i] = dad[i] = 0, DFS(i, ++ts);
      if (cyc) return Print(vec, 1);
    }
  }
  assert(td1 > 0);
  for (int i = 1; i <= ts; i++) cnt[i] = 0;
  for (auto v : adj[v1]) cnt[comp[v]]++;
  for (int i = 1; i <= ts; i++) {
    if (cnt[i] % 3 == 0) {
      vec.clear();
      for (int j = 1; j <= n; j++)
        if (comp[j] == i) vec.push_back(j);
      return Print(vec, 1);
    }
    if (ts >= 2 && cnt[i] % 3 == 1) {
      vec.clear();
      vec.push_back(v1);
      for (int j = 1; j <= n; j++)
        if (comp[j] == i) vec.push_back(j);
      return Print(vec, 1);
    }
  }
  if (ts == 1 && cnt[1] % 3 == 1) {
    assert(0);
    return;
  }
  if (ts >= 3) {
    vec.clear();
    vec.push_back(v1);
    for (int j = 1; j <= n; j++)
      if (comp[j] <= 2 && comp[j]) vec.push_back(j);
    return Print(vec, 1);
  }
  if (ts == 2 && cnt[1] >= 3) {
    sort(adj[v1].begin(), adj[v1].end(),
         [](const int &i, const int &j) { return comp[i] < comp[j]; });
    BFS2(adj[v1][0]);
    long long v2 = adj[v1][1];
    for (auto i : adj[v1]) {
      if (comp[i] == 1 && dis[i] < dis[v2] && i != adj[v1][0]) v2 = i;
    }
    vec.clear();
    vec.push_back(v1);
    while (v2 != -1) vec.push_back(v2), v2 = pr[v2];
    for (int j = 1; j <= n; j++)
      if (comp[j] == 2) vec.push_back(j);
    return Print(vec, 1);
  }
  if (ts == 2 && cnt[2] >= 3) {
    sort(adj[v1].begin(), adj[v1].end(),
         [](const int &i, const int &j) { return comp[i] > comp[j]; });
    BFS2(adj[v1][0]);
    long long v2 = adj[v1][1];
    for (auto i : adj[v1]) {
      if (comp[i] == 2 && dis[i] < dis[v2] && i != adj[v1][0]) v2 = i;
    }
    vec.clear();
    vec.push_back(v1);
    while (v2 != -1) vec.push_back(v2), v2 = pr[v2];
    for (int j = 1; j <= n; j++)
      if (comp[j] == 1) vec.push_back(j);
    return Print(vec, 1);
  }
  cout << "No\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long q;
  cin >> q;
  mq = q;
  while (q--) solve();
  return 0;
}
