#include <bits/stdc++.h>
using namespace std;
const long long N = 5e5 + 10, LOG = 8, M = 1e2 + 10, INF = 1e18 + 10, sn = 320,
                MOD = 1e9 + 7;
void db(string s) { cout << s << "<" << endl; }
void di(int n) { cout << n << "<" << endl; }
long long t, n, m, ti, bel[N], inc[N][21], h[N], par[N], vis[N];
pair<int, int> e[N];
vector<long long> V[N], ans;
void OutputY() {
  long long vis[N];
  for (long long i = 1; i <= n; i++) vis[i] = 1;
  for (long long i = 0; i < ans.size(); i++) vis[ans[i]] = 0;
  long long num = 0;
  for (long long i = 1; i <= n; i++) num += vis[i];
  cout << "Yes\n" << num << '\n';
  for (long long i = 1; i <= n; i++)
    if (vis[i]) cout << i << ' ';
  cout << '\n';
}
bool chk0() {
  if (n == 1) {
    cout << "No\n";
    return 1;
  }
  return 0;
}
bool chk1() {
  for (long long i = 1; i <= n; i++)
    if (!bel[i]) {
      ans.push_back(i);
      OutputY();
      return 1;
    }
  return 0;
}
long long micyc;
pair<int, int> cyc;
void dfs1(long long u, long long f) {
  par[u] = f;
  h[u] = h[f] + 1;
  vis[u] = 1;
  for (long long i = 0; i < V[u].size(); i++) {
    long long v(V[u][i]);
    if (bel[v] != 2 || v == f) continue;
    if (!vis[v])
      dfs1(v, u);
    else if (h[v] < h[u]) {
      long long tmp(h[u] - h[v] + 1);
      if (tmp < micyc) micyc = tmp, cyc = {u, v};
    }
  }
}
bool chk2() {
  long long flag = 1;
  for (long long i = 1; i <= n; i++) flag &= (V[i].size() == 2);
  if (flag) {
    cout << "No\n";
    return 1;
  }
  micyc = INF;
  for (long long i = 1; i <= n; i++) vis[i] = 0;
  for (long long i = 1; i <= n; i++)
    if (bel[i] == 2 && !vis[i]) dfs1(i, 0);
  if (micyc != INF && micyc != n) {
    long long u = cyc.first, v = cyc.second;
    for (; u != v; u = par[u]) {
      ans.push_back(u);
    }
    ans.push_back(v);
    OutputY();
    return 1;
  }
  return 0;
}
long long pre[N];
bool chk3() {
  long long mx = 0, flag = 0;
  for (long long i = 1; i <= n; i++) flag |= (V[i].size() != 2);
  for (long long i = 1; i <= n; i++) flag &= (V[i].size() <= 2);
  if (flag) {
    cout << "No\n";
    return 1;
  }
  long long pos1 = 0, pos2 = 0;
  for (long long i = 1; i <= n; i++)
    if (bel[i] == 1) {
      if (!pos1)
        pos1 = i;
      else
        pos2 = i;
    }
  if (!pos2) return 0;
  queue<long long> que;
  que.push(pos1);
  for (long long i = 1; i <= n; i++) vis[i] = 0;
  vis[pos1] = 1;
  pre[pos1] = 0;
  while (que.size()) {
    long long u(que.front());
    que.pop();
    for (long long i = 0; i < V[u].size(); i++) {
      long long v(V[u][i]);
      if (vis[v]) continue;
      vis[v] = 1;
      pre[v] = u;
      que.push(v);
      if (bel[v] == 1) {
        for (long long x = v; x != pos1; x = pre[x]) ans.push_back(x);
        ans.push_back(pos1);
        OutputY();
        return 1;
      }
    }
  }
  return 0;
}
long long sz1[N], col[N];
void dfs2(long long u, long long f, long long tp) {
  col[u] = tp;
  inc[u][0] = f;
  h[u] = h[f] + 1;
  for (long long i = 1; i <= 20; i++) {
    inc[u][i] = inc[inc[u][i - 1]][i - 1];
  }
  vis[u] = 1;
  long long sz = 0;
  sz1[u] = 1;
  for (long long i = 0; i < V[u].size(); i++) {
    long long v(V[u][i]);
    if (v == f || vis[v]) continue;
    dfs2(v, u, tp);
    ++sz;
    sz1[u] += sz1[v];
  }
}
long long lca(long long x, long long y) {
  if (h[x] < h[y]) swap(x, y);
  for (long long i = 20; i >= 0; i--)
    if (h[inc[x][i]] >= h[y]) x = inc[x][i];
  if (x == y) return x;
  for (long long i = 20; i >= 0; i--)
    if (inc[x][i] != inc[y][i]) {
      x = inc[x][i];
      y = inc[y][i];
    }
  return inc[x][0];
}
long long dist(long long x, long long y) {
  return h[x] + h[y] - (h[lca(x, y)] << 1);
}
bool chk4() {
  static long long cnt[N];
  for (long long i = 1; i <= n; i++) vis[i] = 0;
  long long root = 0;
  for (long long i = 1; i <= n; i++)
    if (bel[i] == 1) root = i;
  vis[root] = 1;
  long long num = 0;
  for (long long i = 1; i <= n; i++)
    if (!vis[i] && bel[i] == 2) {
      dfs2(i, 0, ++num);
      cnt[num] = sz1[i];
    }
  long long flag = 1;
  if (num == 2 && V[root].size() == 4) {
    long long a1(V[root][0]), a2(V[root][1]), a3(V[root][2]), a4(V[root][3]);
    if (col[a3] == col[a1]) swap(a2, a3);
    if (col[a4] == col[a1]) swap(a2, a4);
    flag &= (dist(a1, a2) + 1 == cnt[col[a1]]);
    flag &= (dist(a3, a4) + 1 == cnt[col[a3]]);
    flag &= (n + 1 == m);
    if (flag) {
      cout << "No\n";
      return 1;
    }
  }
  ans.push_back(root);
  long long vis[N];
  for (long long i = 1; i <= n; i++) vis[i] = 0;
  for (long long i = 0; i < V[root].size(); i++) vis[V[root][i]] = 1;
  {
    long long x = 0;
    for (long long i = 0; i < V[root].size(); i++)
      if (col[V[root][i]] == 1) x = V[root][i];
    queue<long long> que;
    que.push(x);
    for (long long i = 1; i <= n; i++) vis[i] = 0;
    vis[x] = 1;
    vis[root] = 1;
    ans.push_back(x);
    while (que.size()) {
      long long u = que.front();
      que.pop();
      for (long long i = 0; i < V[u].size(); i++) {
        long long v(V[u][i]);
        if (vis[v]) continue;
        pre[v] = u;
        que.push(v);
        vis[v] = 1;
        if (vis[v]) {
          u = v;
          do {
            ans.push_back(u);
            u = pre[u];
          } while (u != x);
          while (que.size()) que.pop();
          break;
        }
      }
    }
  }
  {
    long long x = 0;
    for (long long i = 0; i < V[root].size(); i++)
      if (col[V[root][i]] == 2) x = V[root][i];
    queue<long long> que;
    que.push(x);
    for (long long i = 1; i <= n; i++) vis[i] = 0;
    vis[x] = 1;
    vis[root] = 1;
    ans.push_back(x);
    while (que.size()) {
      long long u(que.front());
      que.pop();
      for (long long i = 0; i < V[u].size(); i++) {
        long long v(V[u][i]);
        if (vis[v]) continue;
        pre[v] = u;
        que.push(v);
        vis[v] = 1;
        if (vis[v]) {
          u = v;
          do {
            ans.push_back(u);
            u = pre[u];
          } while (u != x);
          while (que.size()) que.pop();
          break;
        }
      }
    }
  }
  OutputY();
  return 1;
}
void reset() {
  for (long long i = 1; i <= n; i++) vector<long long>().swap(V[i]);
  vector<long long>().swap(ans);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> t;
  for (ti = 1; ti <= t; ti++) {
    cin >> n >> m;
    for (long long i = 1; i <= m; i++) {
      long long x, y;
      cin >> x >> y;
      V[x].push_back(y);
      V[y].push_back(x);
      e[i] = {x, y};
    }
    for (long long i = 1; i <= n; i++) {
      long long tmp(V[i].size());
      bel[i] = tmp % 3;
    }
    if (chk0())
      ;
    else if (chk1())
      ;
    else if (chk2())
      ;
    else if (chk3())
      ;
    else if (chk4())
      ;
    reset();
  }
  return 0;
}
