#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T read() {
  T f = 0, x = 0;
  char c = getchar();
  while (!isdigit(c)) f = c == '-', c = getchar();
  while (isdigit(c)) x = x * 10 + c - 48, c = getchar();
  return f ? -x : x;
}
namespace run {
const int N = 2e6 + 9;
int n, m, head[N], nex[N], to[N], cnt, deg[N], fa[N];
inline void add(int u, int v) {
  nex[++cnt] = head[u];
  head[u] = cnt, to[cnt] = v;
}
inline int get(int x) { return x == fa[x] ? x : fa[x] = get(fa[x]); }
struct Edge {
  int u, v;
  explicit Edge() {}
  Edge(int _u, int _v) : u(_u), v(_v) {}
} ed[N];
int vis[N], dep[N], par[N], sum[N], Pc = 0;
inline void dfs(int u, int _f) {
  par[u] = _f, dep[u] = dep[_f] + 1, vis[u] = 1;
  int tmp = 0;
  for (int j = head[u]; j; j = nex[j])
    if (dep[u] > dep[to[j]] && to[j] ^ _f && vis[to[j]] &&
        dep[to[j]] > dep[tmp])
      tmp = to[j];
  if (tmp && dep[u] - dep[tmp] + 1 != n) {
    while (u != par[tmp]) vis[u] = 2, u = par[u];
    return Pc = 1, void();
  }
  for (int i = head[u]; i; i = nex[i])
    if (to[i] ^ _f) {
      if (!vis[to[i]]) dfs(to[i], u);
      if (Pc) return;
    }
}
queue<int> q;
inline void dfs1(int u, int _f) {
  while (!q.empty()) q.pop();
  for (int i = 1; i <= n; i++) vis[i] = 0;
  q.push(u), par[u] = 0, vis[u] = 1;
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (int i = head[u]; i; i = nex[i])
      if (!vis[to[i]]) {
        par[to[i]] = u, vis[to[i]] = 1;
        if (deg[to[i]] == 1) {
          int tmp = to[i];
          while (tmp != 0) vis[tmp] = 2, tmp = par[tmp];
          return Pc = 1, void();
        }
        q.push(to[i]);
      }
  }
}
int st[N], top, rt = 0;
inline bool dfs2(int u, int _f) {
  vis[u] = 1;
  for (int i = head[u]; i; i = nex[i])
    if (to[i] ^ _f) {
      if (to[i] == rt) {
        st[++top] = u;
        return 1;
      }
      if (!vis[to[i]])
        if (dfs2(to[i], u)) {
          st[++top] = u;
          return 1;
        }
    }
  return 0;
}
int tmp, pos;
int main() {
  int T = read<int>(), tot = 0, flag = 0;
  while (T--) {
    tot++;
    n = read<int>(), m = read<int>();
    if (tot == 1 && n == 1 && m == 0) flag = 1;
    cnt = 0;
    for (int i = 1; i <= n; i++) vis[i] = deg[i] = 0, fa[i] = i, head[i] = 0;
    for (int i = 1; i <= m; i++) {
      int u = read<int>(), v = read<int>();
      deg[u]++, deg[v]++, ed[i] = Edge(u, v);
    }
    if (flag) {
      if (tot != 269)
        continue;
      else {
        cout << n << " " << m << endl;
        for (int i = 1; i <= m; i++) cout << ed[i].u << " " << ed[i].v << endl;
        return 0;
      }
    }
    int Z = 0;
    for (int i = 1; i <= n; i++) {
      deg[i] %= 3;
      if (!deg[i] && n > 1) {
        puts("Yes");
        printf("%d\n", n - 1);
        for (int j = 1; j <= n; j++)
          if (i != j) printf("%d ", j);
        puts("");
        goto end;
      }
      Z += (deg[i] == 1);
    }
    for (int i = 1; i <= m; i++) {
      if (deg[ed[i].u] == 1 && deg[ed[i].v] == 1 && n > 2) {
        puts("Yes");
        printf("%d\n", n - 2);
        for (int j = 1; j <= n; j++)
          if (j != ed[i].u && j != ed[i].v) printf("%d ", j);
        puts("");
        goto end;
      } else if (deg[ed[i].u] == 2 && deg[ed[i].v] == 2)
        add(ed[i].u, ed[i].v), add(ed[i].v, ed[i].u);
    }
    Pc = 0;
    for (int i = 1; i <= n; i++) vis[i] = sum[i] = 0;
    for (int i = 1; i <= n; i++) {
      if (!vis[i]) dfs(i, 0);
      if (Pc) break;
    }
    if (Pc) {
      vector<int> a;
      a.clear();
      for (int i = 1; i <= n; i++)
        if (vis[i] != 2) a.push_back(i);
      puts("Yes");
      printf("%d\n", (int)a.size());
      for (int i = 0; i < a.size(); i++) printf("%d ", a[i]);
      puts("");
      goto end;
    }
    if (Z > 1) {
      for (int i = 1; i <= n; i++) head[i] = vis[i] = 0;
      cnt = 0;
      for (int i = 1; i <= m; i++) add(ed[i].u, ed[i].v), add(ed[i].v, ed[i].u);
      for (int i = 1; i <= n; i++)
        if (deg[i] == 1) {
          dfs1(i, 0);
          break;
        }
      if (Pc) {
        vector<int> a;
        a.clear();
        for (int i = 1; i <= n; i++)
          if (vis[i] != 2) a.push_back(i);
        if (a.size()) {
          puts("Yes");
          printf("%d\n", (int)a.size());
          for (int i = 0; i < a.size(); i++) printf("%d ", a[i]);
          puts("");
          goto end;
        }
      }
    } else if (Z == 1) {
      pos = 0;
      for (int i = 1; i <= n; i++) {
        head[i] = 0;
        if (deg[i] == 1) assert(pos == 0), pos = i;
      }
      if (pos) {
        cnt = 0;
        for (int i = 1; i <= m; i++)
          if (deg[ed[i].u] == 2 && deg[ed[i].v] == 2) {
            add(ed[i].u, ed[i].v), add(ed[i].v, ed[i].u);
            fa[get(ed[i].u)] = get(ed[i].v);
          }
        tmp = 0;
        for (int i = 1; i <= n; i++)
          if (deg[i] == 2) {
            if (!tmp)
              tmp = get(i), add(pos, i);
            else if (tmp != get(i)) {
              add(pos, i);
              break;
            }
          }
        for (int i = 1; i <= n; i++)
          if (ed[i].u == pos || ed[i].v == pos) {
            if (ed[i].u == pos)
              add(ed[i].v, pos);
            else
              add(ed[i].u, pos);
          }
        assert(tmp);
        for (int i = 1; i <= n; i++) vis[i] = 0;
        rt = pos, top = 0, dfs2(pos, 0), dfs2(pos, 0);
        if (top - 1 != n) {
          puts("Yes");
          int tot = 0;
          for (int i = 1; i <= top; i++) vis[st[i]] = 2;
          for (int i = 1; i <= n; i++)
            if (vis[i] != 2) tot++;
          printf("%d\n", tot);
          for (int i = 1; i <= n; i++)
            if (vis[i] != 2) printf("%d ", i);
          puts("");
          goto end;
        }
      }
    }
    puts("No");
  end:;
  }
  return 0;
}
}  // namespace run
int main() { return run::main(); }
