#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 10;
int k, m, n, T;
int deg[maxn];
struct node {
  int x, y;
} E[maxn];
int to[maxn << 1], net[maxn << 1], h[maxn], e = 1;
void add(int x, int y) {
  to[++e] = y;
  net[e] = h[x];
  h[x] = e;
}
vector<int> ans2;
void solve0() {
  int tmp = 0;
  for (int i = 1; i <= n; i++) {
    if (deg[i] % 3 == 0) {
      tmp = i;
      break;
    }
  }
  if (n == 1)
    puts("No");
  else {
    puts("Yes");
    printf("%d\n", n - 1);
    for (int i = 1; i <= n; i++) {
      if (i != tmp) printf("%d ", i);
    }
    puts("");
  }
}
inline bool check1() {
  for (int i = 1; i <= m; i++) {
    if (deg[E[i].x] % 3 == 1 && deg[E[i].y] % 3 == 1) {
      if (n == 2)
        puts("No");
      else {
        puts("Yes");
        printf("%d\n", n - 2);
        for (int j = 1; j <= n; j++) {
          if (j != E[i].x && j != E[i].y) printf("%d ", j);
        }
        puts("");
      }
      return true;
    }
  }
  return false;
}
int root, vis[maxn], ow[maxn];
int dis[maxn], v[maxn];
queue<int> q;
void bfs(int s) {
  for (int i = 1; i <= n; i++) v[i] = 0;
  while (!q.empty()) q.pop();
  v[s] = dis[s] = 1;
  q.push(s);
  while (!q.empty()) {
    int x = q.front();
    q.pop();
    for (int i = h[x]; i; i = net[i]) {
      int y = to[i];
      if (!v[y]) {
        v[y] = 1;
        dis[y] = dis[x] + 1;
        q.push(y);
      }
    }
  }
  return;
}
bool dfs1(int x, int d, int fa) {
  vis[x] = 1;
  for (int i = h[x]; i; i = net[i]) {
    int y = to[i];
    if (y == fa || vis[y] || dis[y] != dis[x] + 1) continue;
    if (deg[y] % 3 == 1) {
      ans2.push_back(x);
      ans2.push_back(y);
      return true;
    }
    if (dfs1(y, dis[y], x)) {
      ans2.push_back(x);
      return true;
    }
  }
  return false;
}
int ok[maxn], dep[maxn], fa[maxn];
vector<int> all;
void DFS(int x) {
  vis[x] = 1;
  all.push_back(x);
  dep[x] = dep[fa[x]] + 1;
  for (int i = h[x]; i; i = net[i]) {
    int y = to[i];
    if (y == fa[x]) continue;
    if (deg[y] % 3 == 1) {
      ok[x] = 1;
      continue;
    }
    fa[y] = x;
    DFS(y);
  }
}
int FLAG;
void dfss(int x) {
  if (FLAG) return;
  dep[x] = dep[fa[x]] + 1;
  vis[x] = 1;
  int depmax = 0;
  for (int i = h[x]; i && !FLAG; i = net[i]) {
    int y = to[i];
    if (y == fa[x] || !ow[y]) continue;
    if (dep[y] && dep[y] <= dep[x]) {
      depmax = max(depmax, dep[y]);
    }
  }
  for (int i = h[x]; i && !FLAG; i = net[i]) {
    int y = to[i];
    if (y == fa[x] || !ow[y]) continue;
    if (dep[y] && dep[y] == depmax) {
      int xx = x, yy = y;
      while (dep[xx] != dep[yy]) {
        if (dep[xx] < dep[yy]) swap(x, y);
        ans2.push_back(xx);
        xx = fa[xx];
      }
      while (dep[xx] && xx != yy) {
        ans2.push_back(xx);
        ans2.push_back(yy);
        xx = fa[xx];
        yy = fa[yy];
      }
      ans2.push_back(xx);
      FLAG = 1;
      return;
    }
  }
  for (int i = h[x]; i && !FLAG; i = net[i]) {
    int y = to[i];
    if (y == fa[x] || !ow[y]) continue;
    fa[y] = x;
    dfss(y);
  }
  return;
}
int num[3];
int main() {
  cin >> T;
  int NUMM = 0;
  while (T--) {
    cin >> n >> m;
    num[0] = num[1] = num[2] = 0;
    for (int i = 1; i <= n; i++) deg[i] = h[i] = 0;
    e = 1;
    for (int i = 1; i <= m; i++) {
      cin >> E[i].x >> E[i].y;
      deg[E[i].x]++;
      deg[E[i].y]++;
    }
    NUMM++;
    for (int i = 1; i <= n; i++) {
      if (deg[i] % 3 == 0) num[0]++;
      if (deg[i] % 3 == 1) num[1]++;
      if (deg[i] % 3 == 2) num[2]++;
    }
    if (num[0]) {
      solve0();
      continue;
    }
    if (check1()) continue;
    for (int i = 1; i <= m; i++) {
      add(E[i].x, E[i].y);
      add(E[i].y, E[i].x);
    }
    for (int i = 1; i <= n; i++) dep[i] = fa[i] = ow[i] = vis[i] = ok[i] = 0;
    ans2.clear();
    FLAG = 0;
    for (int i = 1; i <= n; i++)
      if (deg[i] % 3 == 2) ow[i] = 1;
    for (int i = 1; i <= n; i++) {
      if (ow[i]) {
        dfss(i);
        if (ans2.size()) {
          if (ans2.size() == n) {
            puts("No");
          } else {
            puts("Yes");
            int len = ans2.size();
            printf("%d\n", n - len);
            for (int u = 0; u < len; u++) ok[ans2[u]] = 1;
            for (int u = 1; u <= n; u++) {
              if (!ok[u]) printf("%d ", u);
            }
            puts("");
          }
        }
        break;
      }
    }
    if (FLAG) continue;
    for (int i = 1; i <= n; i++) vis[i] = ok[i] = 0;
    ans2.clear();
    int flag = 0;
    for (int i = 1; i <= n; i++) {
      if (deg[i] % 3 == 1) {
        bfs(i);
        if (dfs1(i, dis[i], 0)) {
          flag = 1;
          if (ans2.size() == n) {
            puts("No");
          } else {
            puts("Yes");
            int len = ans2.size();
            printf("%d\n", n - len);
            for (int u = 0; u < len; u++) ok[ans2[u]] = 1;
            for (int u = 1; u <= n; u++) {
              if (!ok[u]) printf("%d ", u);
            }
            puts("");
          }
          break;
        }
      }
    }
    if (flag) continue;
    for (int i = 1; i <= n; i++) vis[i] = dep[i] = fa[i] = ok[i] = 0;
    ans2.clear();
    for (int i = 1; i <= n; i++)
      if (deg[i] % 3 == 1) ans2.push_back(i);
    int num = 0;
    dep[n + 1] = n + 1;
    for (int i = 1; i <= n; i++) {
      if (deg[i] % 3 == 2 && !vis[i]) {
        all.clear();
        DFS(i);
        num++;
        int len = all.size(), cx = n + 1, zx = n + 1;
        for (int u = 0; u < len; u++) {
          if (ok[all[u]] && dep[all[u]] < dep[zx]) {
            cx = zx;
            zx = all[u];
          } else if (ok[all[u]] && dep[all[u]] < dep[cx]) {
            cx = all[u];
          }
        }
        int x = cx, y = zx;
        while (dep[x] != dep[y]) {
          if (dep[x] < dep[y]) swap(x, y);
          ans2.push_back(x);
          x = fa[x];
        }
        while (x != y) {
          ans2.push_back(x);
          ans2.push_back(y);
          x = fa[x];
          y = fa[y];
        }
        ans2.push_back(x);
        if (num == 2) break;
      }
    }
    for (int i = 1; i <= n; i++) ok[i] = 0;
    if (ans2.size() == n) {
      puts("No");
    } else {
      puts("Yes");
      int len = ans2.size();
      printf("%d\n", n - len);
      for (int u = 0; u < len; u++) ok[ans2[u]] = 1;
      for (int u = 1; u <= n; u++) {
        if (!ok[u]) printf("%d ", u);
      }
      puts("");
    }
  }
  return 0;
}
