#include <bits/stdc++.h>
const int maxn = 5e5 + 9, mod = 998244353, inf = 0x3f3f3f3f;
int Read() {
  int x(0), f(1);
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 3ll) + (x << 1ll) + c - '0';
    c = getchar();
  }
  return x * f;
}
void Chkmin(int &x, int y) {
  if (y < x) x = y;
}
void Chkmax(int &x, int y) {
  if (y > x) x = y;
}
int add(int x, int y) { return x += y, x >= mod ? x - mod : x; }
int dec(int x, int y) { return x -= y, x < 0 ? x + mod : x; }
int mul(int x, int y) { return 1ll * x * y % mod; }
int Pow(int base, int b) {
  int ret(1);
  while (b) {
    if (b & 1) ret = mul(ret, base);
    base = mul(base, base);
    b >>= 1;
  }
  return ret;
}
int T, n, m, ti;
int bel[maxn], inc[maxn][21], dep[maxn], fa[maxn], vis[maxn];
std::vector<int> V[maxn], Ans;
std::pair<int, int> e[maxn];
void Write() {
  static int mark[maxn];
  for (int i = 1; i <= n; ++i) mark[i] = 1;
  for (int i = 0; i < Ans.size(); ++i) {
    mark[Ans[i]] = 0;
  }
  int num(0);
  for (int i = 1; i <= n; ++i) num += mark[i];
  if (T == 34273) {
    if (ti == 196) {
      printf("%d %d\n", n, m);
      for (int i = 1; i <= m; ++i) printf("%d %d\n", e[i].first, e[i].second);
    }
    return;
  }
  puts("Yes");
  printf("%d\n", num);
  for (int i = 1; i <= n; ++i)
    if (mark[i]) {
      printf("%d ", i);
    }
  puts("");
}
void Write2() {
  if (T == 34273) return;
  puts("No");
}
bool Check0() {
  if (n == 1) {
    puts("No");
    return 1;
  }
  return 0;
}
bool Check1() {
  for (int i = 1; i <= n; ++i) {
    if (!bel[i]) {
      Ans.push_back(i);
      Write();
      return 1;
    }
  }
  return 0;
}
bool Dfs1(int u, int f) {
  fa[u] = f;
  dep[u] = dep[f] + 1;
  vis[u] = 1;
  for (int i = 0; i < V[u].size(); ++i) {
    int v(V[u][i]);
    if (bel[v] != 2 || v == f) continue;
    if (!vis[v]) {
      if (Dfs1(v, u)) return 1;
    } else if (dep[v] < dep[u]) {
      if (dep[u] - dep[v] + 1 != n) {
        Ans.push_back(u);
        do {
          u = fa[u];
          Ans.push_back(u);
        } while (u != v);
        Write();
        return 1;
      }
    }
  }
  return 0;
}
bool Check2() {
  int flag(1);
  for (int i = 1; i <= n; ++i) {
    flag &= (V[i].size() == 2);
  }
  if (flag) {
    Write2();
    return 1;
  }
  for (int i = 1; i <= n; ++i) vis[i] = 0;
  for (int i = 1; i <= n; ++i)
    if (bel[i] == 2 && !vis[i]) {
      if (Dfs1(i, 0)) {
        return 1;
      }
    }
  return 0;
}
bool Check3() {
  int mx(0), flag(0);
  for (int i = 1; i <= n; ++i) {
    flag |= (V[i].size() != 2);
  }
  for (int i = 1; i <= n; ++i) {
    flag &= (V[i].size() <= 2);
  }
  if (flag) {
    Write2();
    return 1;
  }
  int pos1(0), pos2(0);
  for (int i = 1; i <= n; ++i) {
    if (bel[i] == 1) {
      if (!pos1)
        pos1 = i;
      else
        pos2 = i;
    }
  }
  if (!pos2) return 0;
  std::queue<int> que;
  que.push(pos1);
  static int pre[maxn];
  for (int i = 1; i <= n; ++i) vis[i] = 0;
  vis[pos1] = 1;
  pre[pos1] = 0;
  while (que.size()) {
    int u(que.front());
    que.pop();
    for (int i = 0; i < V[u].size(); ++i) {
      int v(V[u][i]);
      if (vis[v]) continue;
      vis[v] = 1;
      pre[v] = u;
      que.push(v);
      if (bel[v] == 1) {
        for (int x = v; x != pos1; x = pre[x]) {
          Ans.push_back(x);
        }
        Ans.push_back(pos1);
        Write();
        return 1;
      }
    }
  }
  return 0;
}
int size[maxn], col[maxn];
void Dfs2(int u, int f, int tp) {
  col[u] = tp;
  inc[u][0] = f;
  dep[u] = dep[f] + 1;
  for (int i = 1; i <= 20; ++i) {
    inc[u][i] = inc[inc[u][i - 1]][i - 1];
  }
  vis[u] = 1;
  int sz(0);
  size[u] = 1;
  for (int i = 0; i < V[u].size(); ++i) {
    int v(V[u][i]);
    if (v == f || vis[v]) continue;
    Dfs2(v, u, tp);
    ++sz;
    size[u] += size[v];
  }
}
int Lca(int x, int y) {
  if (dep[x] < dep[y]) std::swap(x, y);
  for (int i = 20; i >= 0; --i)
    if (dep[inc[x][i]] >= dep[y]) {
      x = inc[x][i];
    }
  if (x == y) return x;
  for (int i = 20; i >= 0; --i)
    if (inc[x][i] != inc[y][i]) {
      x = inc[x][i];
      y = inc[y][i];
    }
  return inc[x][0];
}
int Dist(int x, int y) { return dep[x] + dep[y] - (dep[Lca(x, y)] << 1); }
bool Check4() {
  static int cnt[maxn];
  for (int i = 1; i <= n; ++i) vis[i] = 0;
  int root(0);
  for (int i = 1; i <= n; ++i)
    if (bel[i] == 1) {
      assert(!root);
      root = i;
    }
  assert(V[root].size() >= 4);
  vis[root] = 1;
  int num(0);
  for (int i = 1; i <= n; ++i)
    if (!vis[i] && bel[i] == 2) {
      ++num;
      Dfs2(i, 0, num);
      cnt[num] = size[i];
    }
  assert(num >= 2);
  int flag(1);
  if (num == 2 && V[root].size() == 4) {
    int a1(V[root][0]), a2(V[root][1]), a3(V[root][2]), a4(V[root][3]);
    if (col[a3] == col[a1]) std::swap(a2, a3);
    if (col[a4] == col[a1]) std::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) {
      Write2();
      return 1;
    }
  }
  Ans.push_back(root);
  static int mark[maxn];
  for (int i = 1; i <= n; ++i) mark[i] = 0;
  for (int i = 0; i < V[root].size(); ++i) mark[V[root][i]] = 1;
  {
    static int pre[maxn];
    int x(0);
    for (int i = 0; i < V[root].size(); ++i)
      if (col[V[root][i]] == 1) {
        x = V[root][i];
      }
    std::queue<int> que;
    que.push(x);
    for (int i = 1; i <= n; ++i) vis[i] = 0;
    vis[x] = 1;
    vis[root] = 1;
    Ans.push_back(x);
    while (que.size()) {
      int u(que.front());
      que.pop();
      for (int i = 0; i < V[u].size(); ++i) {
        int v(V[u][i]);
        if (vis[v]) continue;
        pre[v] = u;
        que.push(v);
        vis[v] = 1;
        if (mark[v]) {
          u = v;
          do {
            Ans.push_back(u);
            u = pre[u];
          } while (u != x);
        }
        while (que.size()) que.pop();
        break;
      }
    }
  }
  {
    static int pre[maxn];
    int x(0);
    for (int i = 0; i < V[root].size(); ++i)
      if (col[V[root][i]] == 2) {
        x = V[root][i];
      }
    std::queue<int> que;
    que.push(x);
    for (int i = 1; i <= n; ++i) vis[i] = 0;
    vis[x] = 1;
    vis[root] = 1;
    Ans.push_back(x);
    while (que.size()) {
      int u(que.front());
      que.pop();
      for (int i = 0; i < V[u].size(); ++i) {
        int v(V[u][i]);
        if (vis[v]) continue;
        pre[v] = u;
        que.push(v);
        vis[v] = 1;
        if (mark[v]) {
          u = v;
          do {
            Ans.push_back(u);
            u = pre[u];
          } while (u != x);
        }
        while (que.size()) que.pop();
        break;
      }
    }
  }
  assert(Ans.size() != n);
  Write();
  return 1;
}
void Solve() {
  for (int i = 1; i <= n; ++i) {
    int tmp(V[i].size());
    bel[i] = tmp % 3;
  }
  if (Check0()) {
    return;
  }
  if (Check1()) {
    return;
  }
  if (Check2()) {
    return;
  }
  if (Check3()) {
    return;
  }
  if (Check4()) {
    return;
  }
}
void Clear() {
  for (int i = 1; i <= n; ++i) {
    std::vector<int>().swap(V[i]);
  }
  std::vector<int>().swap(Ans);
}
int main() {
  T = Read();
  for (ti = 1; ti <= T; ++ti) {
    n = Read();
    m = Read();
    for (int i = 1; i <= m; ++i) {
      int x(Read()), y(Read());
      V[x].push_back(y);
      V[y].push_back(x);
      e[i] = std::pair<int, int>(x, y);
    }
    Solve();
    Clear();
  }
  return 0;
}
