#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
const int N = 1e6 + 10;
const long long mod = 1e9 + 7;
const long long inf = 8e18;
const int LOG = 20;
long long pw(long long a, long long b, long long M = mod, long long ret = 1) {
  while (b) {
    ret = ret * (b & 1 ? a : 1) % M, a = a * a % M, b >>= 1;
  }
  return ret;
}
int n, m, q, ok, ret, D[N], in[N], h[N], col[N], P[N];
vector<int> G[N];
inline int check0() {
  if (n == 1) {
    return ok = 0;
  }
  for (int i = 1; i <= n; i++) {
    if (!D[i]) {
      return in[i] = 1;
    }
  }
  return 0;
}
inline void bfs(int st, int tp = 0, int c = -1) {
  deque<int> dq;
  h[st] = 0;
  dq.push_back(st);
  col[st] = c;
  while ((int)dq.size()) {
    int v = dq.front();
    dq.pop_front();
    for (auto u : G[v]) {
      if (h[u] == 1e9 && (tp == 0 || D[u] == 2)) {
        h[u] = h[v] + 1;
        dq.push_back(u);
        P[u] = v;
        col[u] = c;
      }
    }
  }
}
inline int check121() {
  if (!ok) return 0;
  for (int i = 1; i <= n; i++)
    if (D[i] == 1 && h[i] == 1e9) bfs(i);
  int node = 0;
  for (int i = 1; i <= n; i++) {
    if (D[i] == 1 && h[i]) {
      if (!node || h[i] < h[node]) node = i;
    }
  }
  if (node == 0) {
    return 0;
  }
  if (h[node] + 1 == n) {
    return ok = 0;
  }
  while (node) {
    in[node] = 1;
    node = P[node];
  }
  return 1;
}
vector<pair<int, int> > option;
void dfs(int v) {
  if (ret) return;
  for (auto u : G[v]) {
    if (D[u] != 2 || u == P[v]) continue;
    if (h[u] < h[v]) {
      option.push_back({v, u});
      continue;
    }
    if (h[u] < 1e9) continue;
    h[u] = h[v] + 1;
    P[u] = v;
    dfs(u);
  }
}
inline int check22() {
  option.clear();
  if (!ok) return 0;
  for (int i = 1; i <= n; i++) h[i] = 1e9, P[i] = 0;
  for (int i = 1; i <= n; i++)
    if (D[i] == 2 && h[i] == 1e9) h[i] = 0, dfs(i);
  if (option.empty()) return 0;
  for (auto cu : option) {
    int v = cu.first, u = cu.second;
    if ((int)option.size() == 1 && h[v] - h[u] + 1 == n) return ok = 0;
    if (h[v] - h[u] + 1 < n) {
      while (v != u) {
        in[v] = 1;
        v = P[v];
      }
      in[u] = 1;
      return 1;
    }
  }
  return 0;
}
inline int check122() {
  if (!ok) return 0;
  int node = 0;
  for (int i = 1; i <= n; i++) {
    if (D[i] == 1) node = i;
  }
  for (int i = 1; i <= n; i++) h[i] = 1e9, P[i] = 0;
  int cnt = 0;
  for (auto u : G[node]) {
    if (D[u] == 2 && h[u] == 1e9) {
      bfs(u, 1, cnt);
      cnt++;
    }
  }
  if (cnt < 2) return 0;
  int choose[2];
  choose[0] = choose[1] = 0;
  for (int _ = 0; _ < 2; _++) {
    for (auto u : G[node]) {
      if (col[u] == _ && h[u] > 0 && (choose[_] == 0 || h[u] < h[choose[_]])) {
        choose[_] = u;
      }
    }
  }
  cnt = in[node] = 1;
  for (int _ = 0; _ < 2; _++) {
    int v = choose[_];
    while (v) {
      in[v] = 1;
      v = P[v];
      cnt++;
    }
  }
  if (cnt == n) {
    for (int i = 1; i <= n; i++) in[i] = 0;
    return 0;
  }
  return 1;
}
inline void solve() {
  scanf("%d%d", &n, &m);
  ret = 0;
  ok = 1;
  for (int i = 1; i <= n; i++)
    G[i].clear(), in[i] = 0, h[i] = 1e9, col[i] = -1, P[i] = 0;
  for (int i = 1; i <= m; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    G[a].push_back(b);
    G[b].push_back(a);
  }
  for (int i = 1; i <= n; i++) D[i] = (int)G[i].size() % 3;
  if (ok == 1 && (check0() || check121() || check22() || check122())) {
    vector<int> Ans;
    for (int i = 1; i <= n; i++)
      if (!in[i]) Ans.push_back(i);
    printf("Yes\n%d\n", (int)Ans.size());
    for (auto x : Ans) printf("%d ", x);
    printf("\n");
    return;
  }
  printf("No\n");
}
int main() {
  scanf("%d", &q);
  while (q--) {
    solve();
  }
  return 0;
}
