#include <bits/stdc++.h>
using namespace std;
vector<int> e[500005];
int d[500005];
void solve0(int n) {
  int id = 0;
  for (int i = 1; i <= n; i++)
    if (!d[i]) {
      id = i;
      break;
    }
  puts("Yes");
  printf("%d\n", n - 1);
  for (int i = 1; i <= n; i++)
    if (i != id) printf("%d ", i);
  printf("\n");
}
queue<int> q;
int p[500005], dep[500005];
bool vis[500005], col[500005];
bool dfs1(int x) {
  col[x] = 1;
  int id = 0;
  for (int i = 0; i < e[x].size(); i++)
    if (e[x][i] != p[x] && d[e[x][i]] == 2 && col[e[x][i]] &&
        (!id || dep[e[x][i]] > dep[id]))
      id = e[x][i];
  if (id) {
    vis[id] = 1;
    for (int j = x; j != id; j = p[j]) vis[j] = 1;
    return 1;
  }
  for (int i = 0; i < e[x].size(); i++)
    if (e[x][i] != p[x] && d[e[x][i]] == 2 && !col[e[x][i]]) {
      int u = e[x][i];
      p[u] = x;
      dep[u] = dep[x] + 1;
      if (dfs1(u)) return 1;
    }
  return 0;
}
bool solve2(int n) {
  for (int i = 1; i <= n; i++)
    if (d[i] == 2 && !col[i] && dfs1(i)) {
      int cnt = 0;
      for (int j = 1; j <= n; j++)
        if (!vis[j]) cnt++;
      if (!cnt) return 0;
      puts("Yes");
      printf("%d\n", cnt);
      for (int j = 1; j <= n; j++)
        if (!vis[j]) printf("%d ", j);
      printf("\n");
      return 1;
    }
  return 0;
}
bool solvebig(int n) {
  for (int i = 1; i <= n; i++) col[i] = 0;
  while (!q.empty()) q.pop();
  int s = 0, t = 0;
  for (int i = 1; i <= n; i++)
    if (d[i] == 1) {
      s = i;
      break;
    }
  q.push(s);
  col[s] = 1;
  while (!q.empty()) {
    int x = q.front();
    q.pop();
    if (x != s && d[x] == 1) {
      t = x;
      break;
    }
    for (int i = 0; i < e[x].size(); i++)
      if (!col[e[x][i]]) {
        int u = e[x][i];
        p[u] = x;
        col[u] = 1;
        q.push(u);
      }
  }
  for (int i = t; i; i = p[i]) vis[i] = 1;
  int cnt = 0;
  for (int i = 1; i <= n; i++)
    if (!vis[i]) cnt++;
  if (!cnt) return 0;
  puts("Yes");
  printf("%d\n", cnt);
  for (int i = 1; i <= n; i++)
    if (!vis[i]) printf("%d ", i);
  printf("\n");
  return 1;
}
bool tag[500005];
bool dfs2(int x, int fa) {
  for (int i = 0; i < e[x].size(); i++)
    if (e[x][i] != fa && d[e[x][i]] == 2) {
      int u = e[x][i];
      if (tag[u]) {
        vis[x] = vis[u] = 1;
        return 1;
      }
      if (dfs2(u, x)) {
        vis[x] = 1;
        return 1;
      }
    }
  return 0;
}
bool solvesmall(int n) {
  for (int i = 1; i <= n; i++) col[i] = p[i] = 0;
  int id = 0;
  for (int i = 1; i <= n; i++)
    if (d[i] == 1) {
      id = i;
      break;
    }
  for (int i = 0; i < e[id].size(); i++) tag[e[id][i]] = 1;
  int cnt = 0;
  for (int i = 1; i <= n; i++)
    if (tag[i] && !col[i]) {
      dfs1(i);
      dfs2(i, 0);
      cnt++;
      if (cnt == 2) break;
    }
  vis[id] = 1;
  cnt = 0;
  for (int i = 1; i <= n; i++)
    if (!vis[i]) cnt++;
  if (!cnt) return 0;
  puts("Yes");
  printf("%d\n", cnt);
  for (int i = 1; i <= n; i++)
    if (!vis[i]) printf("%d ", i);
  printf("\n");
  return 1;
}
void init(int n) {
  for (int i = 1; i <= n; i++) {
    e[i].clear();
    d[i] = p[i] = vis[i] = col[i] = tag[i] = dep[i] = 0;
  }
}
int main() {
  int cases;
  scanf("%d", &cases);
  for (; cases; cases--) {
    int n, m;
    scanf("%d%d", &n, &m);
    init(n);
    for (int i = 1; i <= m; i++) {
      int x, y;
      scanf("%d%d", &x, &y);
      e[x].push_back(y);
      e[y].push_back(x);
      d[x] = (d[x] + 1) % 3;
      d[y] = (d[y] + 1) % 3;
    }
    if (n < 3) {
      puts("No");
      continue;
    }
    bool ok = 0;
    for (int i = 1; i <= n; i++)
      if (!d[i]) {
        ok = 1;
        break;
      }
    if (ok) {
      solve0(n);
      continue;
    }
    if (solve2(n)) continue;
    int cnt = 0;
    for (int i = 1; i <= n; i++)
      if (d[i] == 1) cnt++;
    if (!cnt)
      puts("No");
    else if (cnt == 1) {
      if (!solvesmall(n)) puts("No");
    } else {
      if (!solvebig(n)) puts("No");
    }
  }
  return 0;
}
